<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


Desugaring arrow commands
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.Arrows</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsProcExpr"><span class="hs-identifier">dsProcExpr</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html"><span class="hs-identifier">GHC.HsToCore.Match</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html"><span class="hs-identifier">GHC.HsToCore.Utils</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>   </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Utils.html#collectPatBinders"><span class="hs-identifier">collectPatBinders</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Utils.html#collectPatsBinders"><span class="hs-identifier">collectPatsBinders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>                        </span><span class="annot"><a href="GHC.Hs.Utils.html#collectLStmtsBinders"><span class="hs-identifier">collectLStmtsBinders</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Utils.html#collectLStmtBinders"><span class="hs-identifier">collectLStmtBinders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>                        </span><span class="annot"><a href="GHC.Hs.Utils.html#collectStmtBinders"><span class="hs-identifier">collectStmtBinders</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Hs.Utils.html"><span class="hs-identifier">GHC.Hs.Utils</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">HsUtils</span></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- NB: The desugarer, which straddles the source and Core worlds, sometimes</span><span>
</span><span id="line-32"></span><span class="hs-comment">--     needs to see source types (newtypes etc), and sometimes not</span><span>
</span><span id="line-33"></span><span class="hs-comment">--     So WATCH OUT; check each use of split*Ty functions.</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- Sigh.  This is a pain.</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier">dsExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier">dsLExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExprNoLP"><span class="hs-identifier">dsLExprNoLP</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier">dsLocalBinds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>                                          </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier">dsSyntaxExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#splitPiTy"><span class="hs-identifier">splitPiTy</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html"><span class="hs-identifier">GHC.Core.FVs</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html"><span class="hs-identifier">GHC.HsToCore.Binds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier">dsHsWrapper</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html"><span class="hs-identifier">GHC.Core.ConLike</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html"><span class="hs-identifier">GHC.Data.List.SetOps</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier">assocMaybe</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DSet.html"><span class="hs-identifier">GHC.Types.Unique.DSet</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">data</span><span> </span><span id="DsCmdEnv"><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-var">DsCmdEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="DsCmdEnv"><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-var">DsCmdEnv</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-63"></span><span>        </span><span id="arr_id"><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#arr_id"><span class="hs-identifier hs-var hs-var">arr_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="compose_id"><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#compose_id"><span class="hs-identifier hs-var hs-var">compose_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="first_id"><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#first_id"><span class="hs-identifier hs-var hs-var">first_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="app_id"><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#app_id"><span class="hs-identifier hs-var hs-var">app_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="choice_id"><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#choice_id"><span class="hs-identifier hs-var hs-var">choice_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="loop_id"><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#loop_id"><span class="hs-identifier hs-var hs-var">loop_id</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkCmdEnv"><span class="hs-identifier hs-type">mkCmdEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#CmdSyntaxTable"><span class="hs-identifier hs-type">CmdSyntaxTable</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span class="hs-comment">-- See Note [CmdSyntaxTable] in GHC.Hs.Expr</span><span>
</span><span id="line-68"></span><span id="mkCmdEnv"><span class="annot"><span class="annottext">mkCmdEnv :: CmdSyntaxTable (GhcPass 'Typechecked) -&gt; DsM ([CoreBind], DsCmdEnv)
</span><a href="GHC.HsToCore.Arrows.html#mkCmdEnv"><span class="hs-identifier hs-var hs-var">mkCmdEnv</span></a></span></span><span> </span><span id="local-6989586621681156512"><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156512"><span class="hs-identifier hs-var">tc_meths</span></a></span></span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681156511"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681156511"><span class="hs-identifier hs-var">meth_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156510"><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Name, HsExpr (GhcPass 'Typechecked))
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreBind, (Name, Id)))
-&gt; CmdSyntaxTable (GhcPass 'Typechecked)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ([CoreBind], [(Name, Id)])
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; m (b, c)) -&gt; [a] -&gt; m ([b], [c])
</span><a href="../../base/src/Control.Monad.html#mapAndUnzipM"><span class="hs-identifier hs-var">mapAndUnzipM</span></a></span><span> </span><span class="annot"><span class="annottext">(Name, HsExpr (GhcPass 'Typechecked))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreBind, (Name, Id))
forall {a}.
(a, HsExpr (GhcPass 'Typechecked))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreBind, (a, Id))
</span><a href="#local-6989586621681156508"><span class="hs-identifier hs-var">mk_bind</span></a></span><span> </span><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156512"><span class="hs-identifier hs-var">tc_meths</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span>       </span><span class="hs-comment">-- NB: Some of these lookups might fail, but that's OK if the</span><span>
</span><span id="line-72"></span><span>       </span><span class="hs-comment">-- symbol is never used. That's why we use Maybe first and then</span><span>
</span><span id="line-73"></span><span>       </span><span class="hs-comment">-- panic. An eager panic caused trouble in typecheck/should_compile/tc192</span><span>
</span><span id="line-74"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156507"><span class="annot"><span class="annottext">the_arr_id :: Maybe Id
</span><a href="#local-6989586621681156507"><span class="hs-identifier hs-var hs-var">the_arr_id</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id)] -&gt; Name -&gt; Maybe Id
forall a b. Eq a =&gt; Assoc a b -&gt; a -&gt; Maybe b
</span><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier hs-var">assocMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#arrAName"><span class="hs-identifier hs-var">arrAName</span></a></span><span>
</span><span id="line-75"></span><span>             </span><span id="local-6989586621681156505"><span class="annot"><span class="annottext">the_compose_id :: Maybe Id
</span><a href="#local-6989586621681156505"><span class="hs-identifier hs-var hs-var">the_compose_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id)] -&gt; Name -&gt; Maybe Id
forall a b. Eq a =&gt; Assoc a b -&gt; a -&gt; Maybe b
</span><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier hs-var">assocMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#composeAName"><span class="hs-identifier hs-var">composeAName</span></a></span><span>
</span><span id="line-76"></span><span>             </span><span id="local-6989586621681156503"><span class="annot"><span class="annottext">the_first_id :: Maybe Id
</span><a href="#local-6989586621681156503"><span class="hs-identifier hs-var hs-var">the_first_id</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id)] -&gt; Name -&gt; Maybe Id
forall a b. Eq a =&gt; Assoc a b -&gt; a -&gt; Maybe b
</span><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier hs-var">assocMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#firstAName"><span class="hs-identifier hs-var">firstAName</span></a></span><span>
</span><span id="line-77"></span><span>             </span><span id="local-6989586621681156501"><span class="annot"><span class="annottext">the_app_id :: Maybe Id
</span><a href="#local-6989586621681156501"><span class="hs-identifier hs-var hs-var">the_app_id</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id)] -&gt; Name -&gt; Maybe Id
forall a b. Eq a =&gt; Assoc a b -&gt; a -&gt; Maybe b
</span><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier hs-var">assocMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#appAName"><span class="hs-identifier hs-var">appAName</span></a></span><span>
</span><span id="line-78"></span><span>             </span><span id="local-6989586621681156499"><span class="annot"><span class="annottext">the_choice_id :: Maybe Id
</span><a href="#local-6989586621681156499"><span class="hs-identifier hs-var hs-var">the_choice_id</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id)] -&gt; Name -&gt; Maybe Id
forall a b. Eq a =&gt; Assoc a b -&gt; a -&gt; Maybe b
</span><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier hs-var">assocMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#choiceAName"><span class="hs-identifier hs-var">choiceAName</span></a></span><span>
</span><span id="line-79"></span><span>             </span><span id="local-6989586621681156497"><span class="annot"><span class="annottext">the_loop_id :: Maybe Id
</span><a href="#local-6989586621681156497"><span class="hs-identifier hs-var hs-var">the_loop_id</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Id)] -&gt; Name -&gt; Maybe Id
forall a b. Eq a =&gt; Assoc a b -&gt; a -&gt; Maybe b
</span><a href="GHC.Data.List.SetOps.html#assocMaybe"><span class="hs-identifier hs-var">assocMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Id)]
</span><a href="#local-6989586621681156510"><span class="hs-identifier hs-var">prs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#loopAName"><span class="hs-identifier hs-var">loopAName</span></a></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>           </span><span class="hs-comment">-- used as an argument in, e.g., do_premap</span><span>
</span><span id="line-82"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156507"><span class="hs-identifier hs-var">the_arr_id</span></a></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span>           </span><span class="hs-comment">-- used as an argument in, e.g., dsCmdStmt/BodyStmt</span><span>
</span><span id="line-85"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">5</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156505"><span class="hs-identifier hs-var">the_compose_id</span></a></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>           </span><span class="hs-comment">-- used as an argument in, e.g., dsCmdStmt/BodyStmt</span><span>
</span><span id="line-88"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156503"><span class="hs-identifier hs-var">the_first_id</span></a></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>           </span><span class="hs-comment">-- the result of the_app_id is used as an argument in, e.g.,</span><span>
</span><span id="line-91"></span><span>           </span><span class="hs-comment">-- dsCmd/HsCmdArrApp/HsHigherOrderApp</span><span>
</span><span id="line-92"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156501"><span class="hs-identifier hs-var">the_app_id</span></a></span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span>           </span><span class="hs-comment">-- used as an argument in, e.g., HsCmdIf</span><span>
</span><span id="line-95"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">5</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156499"><span class="hs-identifier hs-var">the_choice_id</span></a></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span>           </span><span class="hs-comment">-- used as an argument in, e.g., RecStmt</span><span>
</span><span id="line-98"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156497"><span class="hs-identifier hs-var">the_loop_id</span></a></span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([CoreBind], DsCmdEnv) -&gt; DsM ([CoreBind], DsCmdEnv)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681156511"><span class="hs-identifier hs-var">meth_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv :: CoreExpr
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsCmdEnv
</span><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-101"></span><span>               </span><span class="annot"><span class="annottext">arr_id :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#arr_id"><span class="hs-identifier hs-var">arr_id</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Id -&gt; Name -&gt; Id
forall {a} {a}. Outputable a =&gt; Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156507"><span class="hs-identifier hs-var">the_arr_id</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#arrAName"><span class="hs-identifier hs-var">arrAName</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>               </span><span class="annot"><span class="annottext">compose_id :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#compose_id"><span class="hs-identifier hs-var">compose_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Id -&gt; Name -&gt; Id
forall {a} {a}. Outputable a =&gt; Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156505"><span class="hs-identifier hs-var">the_compose_id</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#composeAName"><span class="hs-identifier hs-var">composeAName</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-103"></span><span>               </span><span class="annot"><span class="annottext">first_id :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#first_id"><span class="hs-identifier hs-var">first_id</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Id -&gt; Name -&gt; Id
forall {a} {a}. Outputable a =&gt; Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156503"><span class="hs-identifier hs-var">the_first_id</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#firstAName"><span class="hs-identifier hs-var">firstAName</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-104"></span><span>               </span><span class="annot"><span class="annottext">app_id :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#app_id"><span class="hs-identifier hs-var">app_id</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Id -&gt; Name -&gt; Id
forall {a} {a}. Outputable a =&gt; Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156501"><span class="hs-identifier hs-var">the_app_id</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#appAName"><span class="hs-identifier hs-var">appAName</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>               </span><span class="annot"><span class="annottext">choice_id :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#choice_id"><span class="hs-identifier hs-var">choice_id</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Id -&gt; Name -&gt; Id
forall {a} {a}. Outputable a =&gt; Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156499"><span class="hs-identifier hs-var">the_choice_id</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#choiceAName"><span class="hs-identifier hs-var">choiceAName</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-106"></span><span>               </span><span class="annot"><span class="annottext">loop_id :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#loop_id"><span class="hs-identifier hs-var">loop_id</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Id -&gt; Name -&gt; Id
forall {a} {a}. Outputable a =&gt; Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681156497"><span class="hs-identifier hs-var">the_loop_id</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#loopAName"><span class="hs-identifier hs-var">loopAName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>             </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-108"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-109"></span><span>    </span><span id="local-6989586621681156508"><span class="annot"><span class="annottext">mk_bind :: (a, HsExpr (GhcPass 'Typechecked))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreBind, (a, Id))
</span><a href="#local-6989586621681156508"><span class="hs-identifier hs-var hs-var">mk_bind</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681156489"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681156489"><span class="hs-identifier hs-var">std_name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156488"><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156488"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681156487"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156487"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156488"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-111"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681156486"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156486"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156487"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>           </span><span class="hs-comment">-- no check needed; these are functions</span><span>
</span><span id="line-113"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreBind, (a, Id))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (CoreBind, (a, Id))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156486"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156487"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681156489"><span class="hs-identifier hs-var">std_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156486"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621681156493"><span class="annot"><span class="annottext">unmaybe :: Maybe a -&gt; a -&gt; a
</span><a href="#local-6989586621681156493"><span class="hs-identifier hs-var hs-var">unmaybe</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621681156477"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681156477"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; a
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkCmdEnv&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Not found:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681156477"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>    </span><span class="annot"><a href="#local-6989586621681156493"><span class="hs-identifier hs-var">unmaybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681156472"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681156472"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681156472"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span>      </span><span class="hs-comment">-- returns the result type of a pi-type (that is, a forall or a function)</span><span>
</span><span id="line-119"></span><span>      </span><span class="hs-comment">-- Note that this result type may be ill-scoped.</span><span>
</span><span id="line-120"></span><span>    </span><span class="annot"><a href="#local-6989586621681156471"><span class="hs-identifier hs-type">res_type</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621681156471"><span class="annot"><span class="annottext">res_type :: Type -&gt; Type
</span><a href="#local-6989586621681156471"><span class="hs-identifier hs-var hs-var">res_type</span></a></span></span><span> </span><span id="local-6989586621681156470"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156470"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156469"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-122"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-123"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoBinder
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156469"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156469"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (TyCoBinder, Type)
</span><a href="GHC.Core.Type.html#splitPiTy"><span class="hs-identifier hs-var">splitPiTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156470"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span>    </span><span class="annot"><a href="#local-6989586621681156495"><span class="hs-identifier hs-type">check_lev_poly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-comment">-- arity</span><span>
</span><span id="line-126"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>    </span><span id="local-6989586621681156495"><span class="annot"><span class="annottext">check_lev_poly :: Int -&gt; Maybe Id -&gt; DsM ()
</span><a href="#local-6989586621681156495"><span class="hs-identifier hs-var hs-var">check_lev_poly</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>     </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>    </span><span class="annot"><a href="#local-6989586621681156495"><span class="hs-identifier hs-var">check_lev_poly</span></a></span><span> </span><span id="local-6989586621681156468"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681156468"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681156467"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156467"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPoly"><span class="hs-identifier hs-var">dsNoLevPoly</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; (Type -&gt; Type) -&gt; Type -&gt; Type
forall a. Int -&gt; (a -&gt; a) -&gt; a -&gt; a
</span><a href="GHC.Utils.Misc.html#nTimes"><span class="hs-identifier hs-var">nTimes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681156468"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type
</span><a href="#local-6989586621681156471"><span class="hs-identifier hs-var">res_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156467"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the result of the function&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156467"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">-- arr :: forall b c. (b -&gt; c) -&gt; a b c</span><span>
</span><span id="line-134"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-type">do_arr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-135"></span><span id="do_arr"><span class="annot"><span class="annottext">do_arr :: DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var hs-var">do_arr</span></a></span></span><span> </span><span id="local-6989586621681156461"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156461"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156460"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156460"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156459"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156459"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681156458"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156458"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#arr_id"><span class="hs-identifier hs-var hs-var">arr_id</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156461"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156460"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156459"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156458"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="hs-comment">-- (&gt;&gt;&gt;) :: forall b c d. a b c -&gt; a c d -&gt; a b d</span><span>
</span><span id="line-138"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-type">do_compose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-139"></span><span>                </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-140"></span><span id="do_compose"><span class="annot"><span class="annottext">do_compose :: DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var hs-var">do_compose</span></a></span></span><span> </span><span id="local-6989586621681156454"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156454"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156453"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156453"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156452"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156452"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681156451"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156451"><span class="hs-identifier hs-var">d_ty</span></a></span></span><span> </span><span id="local-6989586621681156450"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156450"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681156449"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156449"><span class="hs-identifier hs-var">g</span></a></span></span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#compose_id"><span class="hs-identifier hs-var hs-var">compose_id</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156454"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156453"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156452"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156451"><span class="hs-identifier hs-var">d_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156450"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156449"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">-- first :: forall b c d. a b c -&gt; a (b,d) (c,d)</span><span>
</span><span id="line-144"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_first"><span class="hs-identifier hs-type">do_first</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-145"></span><span id="do_first"><span class="annot"><span class="annottext">do_first :: DsCmdEnv -&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_first"><span class="hs-identifier hs-var hs-var">do_first</span></a></span></span><span> </span><span id="local-6989586621681156447"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156447"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156446"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156446"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156445"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156445"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681156444"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156444"><span class="hs-identifier hs-var">d_ty</span></a></span></span><span> </span><span id="local-6989586621681156443"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156443"><span class="hs-identifier hs-var">f</span></a></span></span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#first_id"><span class="hs-identifier hs-var hs-var">first_id</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156447"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156446"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156445"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156444"><span class="hs-identifier hs-var">d_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156443"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-comment">-- app :: forall b c. a (a b c, b) c</span><span>
</span><span id="line-149"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_app"><span class="hs-identifier hs-type">do_app</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-150"></span><span id="do_app"><span class="annot"><span class="annottext">do_app :: DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_app"><span class="hs-identifier hs-var hs-var">do_app</span></a></span></span><span> </span><span id="local-6989586621681156441"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156441"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156440"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156440"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156439"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156439"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#app_id"><span class="hs-identifier hs-var hs-var">app_id</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156441"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156440"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156439"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-comment">-- (|||) :: forall b d c. a b d -&gt; a c d -&gt; a (Either b c) d</span><span>
</span><span id="line-153"></span><span class="hs-comment">-- note the swapping of d and c</span><span>
</span><span id="line-154"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_choice"><span class="hs-identifier hs-type">do_choice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-155"></span><span>                </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-156"></span><span id="do_choice"><span class="annot"><span class="annottext">do_choice :: DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_choice"><span class="hs-identifier hs-var hs-var">do_choice</span></a></span></span><span> </span><span id="local-6989586621681156437"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156437"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156436"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156436"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156435"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156435"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681156434"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156434"><span class="hs-identifier hs-var">d_ty</span></a></span></span><span> </span><span id="local-6989586621681156433"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156433"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681156432"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156432"><span class="hs-identifier hs-var">g</span></a></span></span><span>
</span><span id="line-157"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#choice_id"><span class="hs-identifier hs-var hs-var">choice_id</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156437"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156436"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156434"><span class="hs-identifier hs-var">d_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156435"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156433"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156432"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-comment">-- loop :: forall b d c. a (b,d) (c,d) -&gt; a b c</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- note the swapping of d and c</span><span>
</span><span id="line-161"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_loop"><span class="hs-identifier hs-type">do_loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-162"></span><span id="do_loop"><span class="annot"><span class="annottext">do_loop :: DsCmdEnv -&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_loop"><span class="hs-identifier hs-var hs-var">do_loop</span></a></span></span><span> </span><span id="local-6989586621681156430"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156430"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156429"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156429"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156428"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156428"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681156427"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156427"><span class="hs-identifier hs-var">d_ty</span></a></span></span><span> </span><span id="local-6989586621681156426"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156426"><span class="hs-identifier hs-var">f</span></a></span></span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#loop_id"><span class="hs-identifier hs-var hs-var">loop_id</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156430"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156429"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156427"><span class="hs-identifier hs-var">d_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156428"><span class="hs-identifier hs-var">c_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156426"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">-- premap :: forall b c d. (b -&gt; c) -&gt; a c d -&gt; a b d</span><span>
</span><span id="line-166"></span><span class="hs-comment">-- premap f g = arr f &gt;&gt;&gt; g</span><span>
</span><span id="line-167"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-type">do_premap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-168"></span><span>                </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-169"></span><span id="do_premap"><span class="annot"><span class="annottext">do_premap :: DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var hs-var">do_premap</span></a></span></span><span> </span><span id="local-6989586621681156424"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156424"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156423"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156423"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span id="local-6989586621681156422"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156422"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681156421"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156421"><span class="hs-identifier hs-var">d_ty</span></a></span></span><span> </span><span id="local-6989586621681156420"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156420"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681156419"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156419"><span class="hs-identifier hs-var">g</span></a></span></span><span>
</span><span id="line-170"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156424"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156423"><span class="hs-identifier hs-var">b_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156422"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156421"><span class="hs-identifier hs-var">d_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var">do_arr</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156424"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156423"><span class="hs-identifier hs-var">b_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156422"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156420"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156419"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkFailExpr"><span class="hs-identifier hs-type">mkFailExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-173"></span><span id="mkFailExpr"><span class="annot"><span class="annottext">mkFailExpr :: HsMatchContext GhcRn -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkFailExpr"><span class="hs-identifier hs-var hs-var">mkFailExpr</span></a></span></span><span> </span><span id="local-6989586621681156417"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681156417"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681156416"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156416"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-174"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type -&gt; SDoc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkErrorAppDs"><span class="hs-identifier hs-var">mkErrorAppDs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#pAT_ERROR_ID"><span class="hs-identifier hs-var">pAT_ERROR_ID</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156416"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; SDoc
forall (p :: Pass).
OutputableBndrId p =&gt;
HsMatchContext (GhcPass p) -&gt; SDoc
</span><a href="GHC.Hs.Expr.html#matchContextErrString"><span class="hs-identifier hs-var">matchContextErrString</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681156417"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- construct CoreExpr for \ (a :: a_ty, b :: b_ty) -&gt; a</span><span>
</span><span id="line-177"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkFstExpr"><span class="hs-identifier hs-type">mkFstExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-178"></span><span id="mkFstExpr"><span class="annot"><span class="annottext">mkFstExpr :: Type -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkFstExpr"><span class="hs-identifier hs-var hs-var">mkFstExpr</span></a></span></span><span> </span><span id="local-6989586621681156411"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156411"><span class="hs-identifier hs-var">a_ty</span></a></span></span><span> </span><span id="local-6989586621681156410"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156410"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-179"></span><span>    </span><span id="local-6989586621681156409"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156409"><span class="hs-identifier hs-var">a_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156411"><span class="hs-identifier hs-var">a_ty</span></a></span><span>
</span><span id="line-180"></span><span>    </span><span id="local-6989586621681156408"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156408"><span class="hs-identifier hs-var">b_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156410"><span class="hs-identifier hs-var">b_ty</span></a></span><span>
</span><span id="line-181"></span><span>    </span><span id="local-6989586621681156407"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156407"><span class="hs-identifier hs-var">pair_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156411"><span class="hs-identifier hs-var">a_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156410"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156407"><span class="hs-identifier hs-var">pair_var</span></a></span><span>
</span><span id="line-183"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-var">coreCasePair</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156407"><span class="hs-identifier hs-var">pair_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156409"><span class="hs-identifier hs-var">a_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156408"><span class="hs-identifier hs-var">b_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156409"><span class="hs-identifier hs-var">a_var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-comment">-- construct CoreExpr for \ (a :: a_ty, b :: b_ty) -&gt; b</span><span>
</span><span id="line-186"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkSndExpr"><span class="hs-identifier hs-type">mkSndExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-187"></span><span id="mkSndExpr"><span class="annot"><span class="annottext">mkSndExpr :: Type -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkSndExpr"><span class="hs-identifier hs-var hs-var">mkSndExpr</span></a></span></span><span> </span><span id="local-6989586621681156402"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156402"><span class="hs-identifier hs-var">a_ty</span></a></span></span><span> </span><span id="local-6989586621681156401"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156401"><span class="hs-identifier hs-var">b_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-188"></span><span>    </span><span id="local-6989586621681156400"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156400"><span class="hs-identifier hs-var">a_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156402"><span class="hs-identifier hs-var">a_ty</span></a></span><span>
</span><span id="line-189"></span><span>    </span><span id="local-6989586621681156399"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156399"><span class="hs-identifier hs-var">b_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156401"><span class="hs-identifier hs-var">b_ty</span></a></span><span>
</span><span id="line-190"></span><span>    </span><span id="local-6989586621681156398"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156398"><span class="hs-identifier hs-var">pair_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156402"><span class="hs-identifier hs-var">a_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156401"><span class="hs-identifier hs-var">b_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156398"><span class="hs-identifier hs-var">pair_var</span></a></span><span>
</span><span id="line-192"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-var">coreCasePair</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156398"><span class="hs-identifier hs-var">pair_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156400"><span class="hs-identifier hs-var">a_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156399"><span class="hs-identifier hs-var">b_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156399"><span class="hs-identifier hs-var">b_var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="hs-comment">{-
Build case analysis of a tuple.  This cannot be done in the DsM monad,
because the list of variables is typically not yet defined.
-}</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-comment">-- coreCaseTuple [u1..] v [x1..xn] body</span><span>
</span><span id="line-200"></span><span class="hs-comment">--      = case v of v { (x1, .., xn) -&gt; body }</span><span>
</span><span id="line-201"></span><span class="hs-comment">-- But the matching may be nested if the tuple is very big</span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#coreCaseTuple"><span class="hs-identifier hs-type">coreCaseTuple</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-204"></span><span id="coreCaseTuple"><span class="annot"><span class="annottext">coreCaseTuple :: UniqSupply -&gt; Id -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCaseTuple"><span class="hs-identifier hs-var hs-var">coreCaseTuple</span></a></span></span><span> </span><span id="local-6989586621681156396"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681156396"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span id="local-6989586621681156395"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156395"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621681156394"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156394"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621681156393"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156393"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-205"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Id] -&gt; CoreExpr -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleCase"><span class="hs-identifier hs-var">mkTupleCase</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681156396"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156394"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156393"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156395"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156395"><span class="hs-identifier hs-var">scrut_var</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-type">coreCasePair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-208"></span><span id="coreCasePair"><span class="annot"><span class="annottext">coreCasePair :: Id -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-var hs-var">coreCasePair</span></a></span></span><span> </span><span id="local-6989586621681156391"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156391"><span class="hs-identifier hs-var">scrut_var</span></a></span></span><span> </span><span id="local-6989586621681156390"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156390"><span class="hs-identifier hs-var">var1</span></a></span></span><span> </span><span id="local-6989586621681156389"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156389"><span class="hs-identifier hs-var">var2</span></a></span></span><span> </span><span id="local-6989586621681156388"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156388"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-209"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CoreExpr
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156391"><span class="hs-identifier hs-var">scrut_var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156391"><span class="hs-identifier hs-var">scrut_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156388"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span>         </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Boxed"><span class="hs-identifier hs-var">Boxed</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156390"><span class="hs-identifier hs-var">var1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156389"><span class="hs-identifier hs-var">var2</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156388"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-type">mkCorePairTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-213"></span><span id="mkCorePairTy"><span class="annot"><span class="annottext">mkCorePairTy :: Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var hs-var">mkCorePairTy</span></a></span></span><span> </span><span id="local-6989586621681156383"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156383"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621681156382"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156382"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Type
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156383"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156382"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-type">mkCorePairExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-216"></span><span id="mkCorePairExpr"><span class="annot"><span class="annottext">mkCorePairExpr :: CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var hs-var">mkCorePairExpr</span></a></span></span><span> </span><span id="local-6989586621681156379"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156379"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681156378"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156378"><span class="hs-identifier hs-var">e2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier hs-var">mkCoreTup</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156379"><span class="hs-identifier hs-var">e1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156378"><span class="hs-identifier hs-var">e2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkCoreUnitExpr"><span class="hs-identifier hs-type">mkCoreUnitExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-219"></span><span id="mkCoreUnitExpr"><span class="annot"><span class="annottext">mkCoreUnitExpr :: CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCoreUnitExpr"><span class="hs-identifier hs-var hs-var">mkCoreUnitExpr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreTup"><span class="hs-identifier hs-var">mkCoreTup</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span class="hs-comment">{-
The input is divided into a local environment, which is a flat tuple
(unless it's too big), and a stack, which is a right-nested pair.
In general, the input has the form

        ((x1,...,xn), (s1,...(sk,())...))

where xi are the environment values, and si the ones on the stack,
with s1 being the &quot;top&quot;, the first one to be matched with a lambda.
-}</span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-type">envStackType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-233"></span><span id="envStackType"><span class="annot"><span class="annottext">envStackType :: [Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var hs-var">envStackType</span></a></span></span><span> </span><span id="local-6989586621681156374"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156374"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156373"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156373"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156374"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156373"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-comment">-- splitTypeAt n (t1,... (tn,t)...) = ([t1, ..., tn], t)</span><span>
</span><span id="line-236"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#splitTypeAt"><span class="hs-identifier hs-type">splitTypeAt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span id="splitTypeAt"><span class="annot"><span class="annottext">splitTypeAt :: Int -&gt; Type -&gt; ([Type], Type)
</span><a href="GHC.HsToCore.Arrows.html#splitTypeAt"><span class="hs-identifier hs-var hs-var">splitTypeAt</span></a></span></span><span> </span><span id="local-6989586621681156370"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681156370"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681156369"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156369"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681156370"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156369"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [Type]
</span><a href="GHC.Tc.Utils.TcType.html#tcTyConAppArgs"><span class="hs-identifier hs-var">tcTyConAppArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156369"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-240"></span><span>      </span><span class="hs-special">[</span><span id="local-6989586621681156367"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156367"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156366"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156366"><span class="hs-identifier hs-var">ty'</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681156365"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681156365"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156364"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156364"><span class="hs-identifier hs-var">ty_r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Type -&gt; ([Type], Type)
</span><a href="GHC.HsToCore.Arrows.html#splitTypeAt"><span class="hs-identifier hs-var">splitTypeAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681156370"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156366"><span class="hs-identifier hs-var">ty'</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156367"><span class="hs-identifier hs-var">t</span></a></span><span class="annot"><span class="annottext">Type -&gt; [Type] -&gt; [Type]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681156365"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156364"><span class="hs-identifier hs-var">ty_r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-241"></span><span>      </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ([Type], Type)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;splitTypeAt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156369"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-244"></span><span class="hs-comment">--              buildEnvStack</span><span>
</span><span id="line-245"></span><span class="hs-comment">--</span><span>
</span><span id="line-246"></span><span class="hs-comment">--      ((x1,...,xn),stk)</span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-type">buildEnvStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-249"></span><span id="buildEnvStack"><span class="annot"><span class="annottext">buildEnvStack :: [Id] -&gt; Id -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-var hs-var">buildEnvStack</span></a></span></span><span> </span><span id="local-6989586621681156362"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156362"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span id="local-6989586621681156361"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156361"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156362"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156361"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-253"></span><span class="hs-comment">--              matchEnvStack</span><span>
</span><span id="line-254"></span><span class="hs-comment">--</span><span>
</span><span id="line-255"></span><span class="hs-comment">--      \ ((x1,...,xn),stk) -&gt; body</span><span>
</span><span id="line-256"></span><span class="hs-comment">--      =&gt;</span><span>
</span><span id="line-257"></span><span class="hs-comment">--      \ pair -&gt;</span><span>
</span><span id="line-258"></span><span class="hs-comment">--      case pair of (tup,stk) -&gt;</span><span>
</span><span id="line-259"></span><span class="hs-comment">--      case tup of (x1,...,xn) -&gt;</span><span>
</span><span id="line-260"></span><span class="hs-comment">--      body</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-type">matchEnvStack</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- x1..xn</span><span>
</span><span id="line-263"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>           </span><span class="hs-comment">-- stk</span><span>
</span><span id="line-264"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- e</span><span>
</span><span id="line-265"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-266"></span><span id="matchEnvStack"><span class="annot"><span class="annottext">matchEnvStack :: [Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var hs-var">matchEnvStack</span></a></span></span><span> </span><span id="local-6989586621681156358"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156358"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span id="local-6989586621681156357"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156357"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span id="local-6989586621681156356"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156356"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-267"></span><span>    </span><span id="local-6989586621681156355"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681156355"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf DsGblEnv DsLclEnv UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-268"></span><span>    </span><span id="local-6989586621681156353"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156353"><span class="hs-identifier hs-var">tup_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156358"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156352"><span class="annot"><span class="annottext">match_env :: CoreExpr
</span><a href="#local-6989586621681156352"><span class="hs-identifier hs-var hs-var">match_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; Id -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCaseTuple"><span class="hs-identifier hs-var">coreCaseTuple</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681156355"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156353"><span class="hs-identifier hs-var">tup_var</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156358"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156356"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-270"></span><span>    </span><span id="local-6989586621681156351"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156351"><span class="hs-identifier hs-var">pair_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156353"><span class="hs-identifier hs-var">tup_var</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156357"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156351"><span class="hs-identifier hs-var">pair_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-var">coreCasePair</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156351"><span class="hs-identifier hs-var">pair_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156353"><span class="hs-identifier hs-var">tup_var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156357"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156352"><span class="hs-identifier hs-var">match_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-274"></span><span class="hs-comment">--              matchEnv</span><span>
</span><span id="line-275"></span><span class="hs-comment">--</span><span>
</span><span id="line-276"></span><span class="hs-comment">--      \ (x1,...,xn) -&gt; body</span><span>
</span><span id="line-277"></span><span class="hs-comment">--      =&gt;</span><span>
</span><span id="line-278"></span><span class="hs-comment">--      \ tup -&gt;</span><span>
</span><span id="line-279"></span><span class="hs-comment">--      case tup of (x1,...,xn) -&gt;</span><span>
</span><span id="line-280"></span><span class="hs-comment">--      body</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-type">matchEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- x1..xn</span><span>
</span><span id="line-283"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>    </span><span class="hs-comment">-- e</span><span>
</span><span id="line-284"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-285"></span><span id="matchEnv"><span class="annot"><span class="annottext">matchEnv :: [Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-var hs-var">matchEnv</span></a></span></span><span> </span><span id="local-6989586621681156349"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156349"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span id="local-6989586621681156348"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156348"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-286"></span><span>    </span><span id="local-6989586621681156347"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681156347"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf DsGblEnv DsLclEnv UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-287"></span><span>    </span><span id="local-6989586621681156346"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156346"><span class="hs-identifier hs-var">tup_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156349"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156346"><span class="hs-identifier hs-var">tup_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply -&gt; Id -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCaseTuple"><span class="hs-identifier hs-var">coreCaseTuple</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681156347"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156346"><span class="hs-identifier hs-var">tup_id</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156349"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156348"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-291"></span><span class="hs-comment">--              matchVarStack</span><span>
</span><span id="line-292"></span><span class="hs-comment">--</span><span>
</span><span id="line-293"></span><span class="hs-comment">--      case (x1, ...(xn, s)...) -&gt; e</span><span>
</span><span id="line-294"></span><span class="hs-comment">--      =&gt;</span><span>
</span><span id="line-295"></span><span class="hs-comment">--      case z0 of (x1,z1) -&gt;</span><span>
</span><span id="line-296"></span><span class="hs-comment">--      case zn-1 of (xn,s) -&gt;</span><span>
</span><span id="line-297"></span><span class="hs-comment">--      e</span><span>
</span><span id="line-298"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchVarStack"><span class="hs-identifier hs-type">matchVarStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span id="matchVarStack"><span class="annot"><span class="annottext">matchVarStack :: [Id] -&gt; Id -&gt; CoreExpr -&gt; DsM (Id, CoreExpr)
</span><a href="GHC.HsToCore.Arrows.html#matchVarStack"><span class="hs-identifier hs-var hs-var">matchVarStack</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681156344"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156344"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span id="local-6989586621681156343"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156343"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; DsM (Id, CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156344"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156343"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchVarStack"><span class="hs-identifier hs-var">matchVarStack</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681156342"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156342"><span class="hs-identifier hs-var">param_id</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681156341"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156341"><span class="hs-identifier hs-var">param_ids</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156340"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156340"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span id="local-6989586621681156339"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156339"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-301"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156338"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156338"><span class="hs-identifier hs-var">tail_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156337"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156337"><span class="hs-identifier hs-var">tail_code</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM (Id, CoreExpr)
</span><a href="GHC.HsToCore.Arrows.html#matchVarStack"><span class="hs-identifier hs-var">matchVarStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156341"><span class="hs-identifier hs-var">param_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156340"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156339"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-302"></span><span>    </span><span id="local-6989586621681156336"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156336"><span class="hs-identifier hs-var">pair_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156342"><span class="hs-identifier hs-var">param_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156338"><span class="hs-identifier hs-var">tail_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>    </span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; DsM (Id, CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156336"><span class="hs-identifier hs-var">pair_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-var">coreCasePair</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156336"><span class="hs-identifier hs-var">pair_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156342"><span class="hs-identifier hs-var">param_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156338"><span class="hs-identifier hs-var">tail_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156337"><span class="hs-identifier hs-var">tail_code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#mkHsEnvStackExpr"><span class="hs-identifier hs-type">mkHsEnvStackExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-306"></span><span id="mkHsEnvStackExpr"><span class="annot"><span class="annottext">mkHsEnvStackExpr :: [Id] -&gt; Id -&gt; LHsExpr (GhcPass 'Typechecked)
</span><a href="GHC.HsToCore.Arrows.html#mkHsEnvStackExpr"><span class="hs-identifier hs-var hs-var">mkHsEnvStackExpr</span></a></span></span><span> </span><span id="local-6989586621681156334"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156334"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span id="local-6989586621681156333"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156333"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)] -&gt; LHsExpr (GhcPass 'Typechecked)
forall (a :: Pass). [LHsExpr (GhcPass a)] -&gt; LHsExpr (GhcPass a)
</span><a href="GHC.Hs.Utils.html#mkLHsTupleExpr"><span class="hs-identifier hs-var">mkLHsTupleExpr</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[IdP (GhcPass 'Typechecked)] -&gt; LHsExpr (GhcPass 'Typechecked)
forall (a :: Pass). [IdP (GhcPass a)] -&gt; LHsExpr (GhcPass a)
</span><a href="GHC.Hs.Utils.html#mkLHsVarTuple"><span class="hs-identifier hs-var">mkLHsVarTuple</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156334"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IdP (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156333"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span class="hs-comment">-- Translation of arrow abstraction</span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span class="hs-comment">-- D; xs |-a c : () --&gt; t'      ---&gt; c'</span><span>
</span><span id="line-312"></span><span class="hs-comment">-- --------------------------</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- D |- proc p -&gt; c :: a t t'   ---&gt; premap (\ p -&gt; ((xs),())) c'</span><span>
</span><span id="line-314"></span><span class="hs-comment">--</span><span>
</span><span id="line-315"></span><span class="hs-comment">--              where (xs) is the tuple of variables bound by p</span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsProcExpr"><span class="hs-identifier hs-type">dsProcExpr</span></a></span><span>
</span><span id="line-318"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-319"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-320"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-321"></span><span id="dsProcExpr"><span class="annot"><span class="annottext">dsProcExpr :: LPat (GhcPass 'Typechecked)
-&gt; LHsCmdTop (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#dsProcExpr"><span class="hs-identifier hs-var hs-var">dsProcExpr</span></a></span></span><span> </span><span id="local-6989586621681156329"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156329"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdTop"><span class="hs-identifier hs-type">HsCmdTop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#CmdTopTc"><span class="hs-identifier hs-type">CmdTopTc</span></a></span><span> </span><span id="local-6989586621681156325"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156325"><span class="hs-identifier hs-var">_unitTy</span></a></span></span><span> </span><span id="local-6989586621681156324"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156324"><span class="hs-identifier hs-var">cmd_ty</span></a></span></span><span> </span><span id="local-6989586621681156323"><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156323"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156322"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156322"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-322"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156321"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681156321"><span class="hs-identifier hs-var">meth_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156320"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156320"><span class="hs-identifier hs-var">meth_ids</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked) -&gt; DsM ([CoreBind], DsCmdEnv)
</span><a href="GHC.HsToCore.Arrows.html#mkCmdEnv"><span class="hs-identifier hs-var">mkCmdEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156323"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-323"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156319"><span class="annot"><span class="annottext">locals :: VarSet
</span><a href="#local-6989586621681156319"><span class="hs-identifier hs-var hs-var">locals</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectPatBinders"><span class="hs-identifier hs-var">collectPatBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156329"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156316"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156316"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156315"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156315"><span class="hs-identifier hs-var">_free_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156314"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156314"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156320"><span class="hs-identifier hs-var">meth_ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156319"><span class="hs-identifier hs-var">locals</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156324"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156322"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-326"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156311"><span class="annot"><span class="annottext">env_ty :: Type
</span><a href="#local-6989586621681156311"><span class="hs-identifier hs-var hs-var">env_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156314"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-327"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156310"><span class="annot"><span class="annottext">env_stk_ty :: Type
</span><a href="#local-6989586621681156310"><span class="hs-identifier hs-var hs-var">env_stk_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156311"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span>
</span><span id="line-328"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156309"><span class="annot"><span class="annottext">env_stk_expr :: CoreExpr
</span><a href="#local-6989586621681156309"><span class="hs-identifier hs-var hs-var">env_stk_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156314"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCoreUnitExpr"><span class="hs-identifier hs-var">mkCoreUnitExpr</span></a></span><span>
</span><span id="line-329"></span><span>    </span><span id="local-6989586621681156308"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156308"><span class="hs-identifier hs-var">fail_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkFailExpr"><span class="hs-identifier hs-var">mkFailExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#ProcExpr"><span class="hs-identifier hs-var">ProcExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156310"><span class="hs-identifier hs-var">env_stk_ty</span></a></span><span>
</span><span id="line-330"></span><span>    </span><span id="local-6989586621681156306"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156306"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; LPat (GhcPass 'Typechecked) -&gt; DsM Id
</span><a href="GHC.HsToCore.Utils.html#selectSimpleMatchVarL"><span class="hs-identifier hs-var">selectSimpleMatchVarL</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156329"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-331"></span><span>    </span><span id="local-6989586621681156304"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156304"><span class="hs-identifier hs-var">match_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat (GhcPass 'Typechecked)
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-var">matchSimply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156306"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#ProcExpr"><span class="hs-identifier hs-var">ProcExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156329"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156309"><span class="hs-identifier hs-var">env_stk_expr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156308"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-332"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156302"><span class="annot"><span class="annottext">pat_ty :: Type
</span><a href="#local-6989586621681156302"><span class="hs-identifier hs-var hs-var">pat_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; Type
</span><a href="GHC.Tc.Utils.Zonk.html#hsLPatType"><span class="hs-identifier hs-var">hsLPatType</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156329"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156300"><span class="annot"><span class="annottext">proc_code :: CoreExpr
</span><a href="#local-6989586621681156300"><span class="hs-identifier hs-var hs-var">proc_code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156320"><span class="hs-identifier hs-var">meth_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156302"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156310"><span class="hs-identifier hs-var">env_stk_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156324"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span>
</span><span id="line-334"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156306"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156304"><span class="hs-identifier hs-var">match_code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span>                    </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156316"><span class="hs-identifier hs-var">core_cmd</span></a></span><span>
</span><span id="line-336"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreBind] -&gt; CoreExpr -&gt; CoreExpr
forall b. [Bind b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLets"><span class="hs-identifier hs-var">mkLets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681156321"><span class="hs-identifier hs-var">meth_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156300"><span class="hs-identifier hs-var">proc_code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span class="hs-comment">{-
Translation of a command judgement of the form

        D; xs |-a c : stk --&gt; t

to an expression e such that

        D |- e :: a (xs, stk) t
-}</span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsLCmd"><span class="hs-identifier hs-type">dsLCmd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-349"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-350"></span><span id="dsLCmd"><span class="annot"><span class="annottext">dsLCmd :: DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsLCmd"><span class="hs-identifier hs-var hs-var">dsLCmd</span></a></span></span><span> </span><span id="local-6989586621681156296"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156296"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156295"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156295"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156294"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156294"><span class="hs-identifier hs-var">stk_ty</span></a></span></span><span> </span><span id="local-6989586621681156293"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156293"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681156292"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156292"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span id="local-6989586621681156291"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156291"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span>
</span><span id="line-351"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; HsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156296"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156295"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156294"><span class="hs-identifier hs-var">stk_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156293"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked) -&gt; HsCmd (GhcPass 'Typechecked)
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156292"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156291"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-type">dsCmd</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-354"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this command</span><span>
</span><span id="line-355"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                 </span><span class="hs-comment">-- type of the stack (right-nested tuple)</span><span>
</span><span id="line-356"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                 </span><span class="hs-comment">-- return type of the command</span><span>
</span><span id="line-357"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmd"><span class="hs-identifier hs-type">HsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>           </span><span class="hs-comment">-- command to desugar</span><span>
</span><span id="line-358"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>           </span><span class="hs-comment">-- list of vars in the input to this command</span><span>
</span><span id="line-359"></span><span>                                </span><span class="hs-comment">-- This is typically fed back,</span><span>
</span><span id="line-360"></span><span>                                </span><span class="hs-comment">-- so don't pull on it too early</span><span>
</span><span id="line-361"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-362"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="hs-comment">-- D |- fun :: a t1 t2</span><span>
</span><span id="line-365"></span><span class="hs-comment">-- D, xs |- arg :: t1</span><span>
</span><span id="line-366"></span><span class="hs-comment">-- -----------------------------</span><span>
</span><span id="line-367"></span><span class="hs-comment">-- D; xs |-a fun -&lt; arg : stk --&gt; t2</span><span>
</span><span id="line-368"></span><span class="hs-comment">--</span><span>
</span><span id="line-369"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs), _stk) -&gt; arg) fun</span><span>
</span><span id="line-370"></span><span>
</span><span id="line-371"></span><span id="dsCmd"><span class="annot"><span class="annottext">dsCmd :: DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; HsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var hs-var">dsCmd</span></a></span></span><span> </span><span id="local-6989586621681156288"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156288"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156287"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156287"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156286"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156286"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156285"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156285"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-372"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdArrApp"><span class="hs-identifier hs-type">HsCmdArrApp</span></a></span><span> </span><span id="local-6989586621681156283"><span class="annot"><span class="annottext">XCmdArrApp (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156283"><span class="hs-identifier hs-var">arrow_ty</span></a></span></span><span> </span><span id="local-6989586621681156282"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156282"><span class="hs-identifier hs-var">arrow</span></a></span></span><span> </span><span id="local-6989586621681156281"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156281"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsArrAppType
</span><a href="GHC.Hs.Expr.html#HsFirstOrderApp"><span class="hs-identifier hs-var">HsFirstOrderApp</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>        </span><span id="local-6989586621681156279"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156279"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-374"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-375"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681156278"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156278"><span class="hs-identifier hs-var">a_arg_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156277"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156277"><span class="hs-identifier hs-var">_res_ty'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (Type, Type)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitAppTy"><span class="hs-identifier hs-var">tcSplitAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XCmdArrApp (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156283"><span class="hs-identifier hs-var">arrow_ty</span></a></span><span>
</span><span id="line-376"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681156275"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156275"><span class="hs-identifier hs-var">_a_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156274"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156274"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (Type, Type)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitAppTy"><span class="hs-identifier hs-var">tcSplitAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156278"><span class="hs-identifier hs-var">a_arg_ty</span></a></span><span>
</span><span id="line-377"></span><span>    </span><span id="local-6989586621681156273"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156273"><span class="hs-identifier hs-var">core_arrow</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExprNoLP"><span class="hs-identifier hs-var">dsLExprNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156282"><span class="hs-identifier hs-var">arrow</span></a></span><span>
</span><span id="line-378"></span><span>    </span><span id="local-6989586621681156272"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156272"><span class="hs-identifier hs-var">core_arg</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156281"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-379"></span><span>    </span><span id="local-6989586621681156271"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156271"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156286"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-380"></span><span>    </span><span id="local-6989586621681156270"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156270"><span class="hs-identifier hs-var">core_make_arg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156279"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156271"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156272"><span class="hs-identifier hs-var">core_arg</span></a></span><span>
</span><span id="line-381"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156288"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-382"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156279"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156286"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>              </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156274"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-384"></span><span>              </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156285"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-385"></span><span>              </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156270"><span class="hs-identifier hs-var">core_make_arg</span></a></span><span>
</span><span id="line-386"></span><span>              </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156273"><span class="hs-identifier hs-var">core_arrow</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-387"></span><span>            </span><span class="annot"><span class="annottext">CoreExpr -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprFreeIdsDSet"><span class="hs-identifier hs-var">exprFreeIdsDSet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156272"><span class="hs-identifier hs-var">core_arg</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156287"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span class="hs-comment">-- D, xs |- fun :: a t1 t2</span><span>
</span><span id="line-390"></span><span class="hs-comment">-- D, xs |- arg :: t1</span><span>
</span><span id="line-391"></span><span class="hs-comment">-- ------------------------------</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- D; xs |-a fun -&lt;&lt; arg : stk --&gt; t2</span><span>
</span><span id="line-393"></span><span class="hs-comment">--</span><span>
</span><span id="line-394"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs), _stk) -&gt; (fun, arg)) app</span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156267"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156267"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156266"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156266"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156265"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156265"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156264"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156264"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-397"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdArrApp"><span class="hs-identifier hs-type">HsCmdArrApp</span></a></span><span> </span><span id="local-6989586621681156263"><span class="annot"><span class="annottext">XCmdArrApp (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156263"><span class="hs-identifier hs-var">arrow_ty</span></a></span></span><span> </span><span id="local-6989586621681156262"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156262"><span class="hs-identifier hs-var">arrow</span></a></span></span><span> </span><span id="local-6989586621681156261"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156261"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsArrAppType
</span><a href="GHC.Hs.Expr.html#HsHigherOrderApp"><span class="hs-identifier hs-var">HsHigherOrderApp</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-398"></span><span>        </span><span id="local-6989586621681156259"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156259"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-399"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-400"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681156258"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156258"><span class="hs-identifier hs-var">a_arg_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156257"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156257"><span class="hs-identifier hs-var">_res_ty'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (Type, Type)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitAppTy"><span class="hs-identifier hs-var">tcSplitAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XCmdArrApp (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156263"><span class="hs-identifier hs-var">arrow_ty</span></a></span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681156256"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156256"><span class="hs-identifier hs-var">_a_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156255"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156255"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (Type, Type)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitAppTy"><span class="hs-identifier hs-var">tcSplitAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156258"><span class="hs-identifier hs-var">a_arg_ty</span></a></span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span>    </span><span id="local-6989586621681156254"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156254"><span class="hs-identifier hs-var">core_arrow</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156262"><span class="hs-identifier hs-var">arrow</span></a></span><span>
</span><span id="line-404"></span><span>    </span><span id="local-6989586621681156253"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156253"><span class="hs-identifier hs-var">core_arg</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156261"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-405"></span><span>    </span><span id="local-6989586621681156252"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156252"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156265"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-406"></span><span>    </span><span id="local-6989586621681156251"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156251"><span class="hs-identifier hs-var">core_make_pair</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156259"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156252"><span class="hs-identifier hs-var">stack_id</span></a></span><span>
</span><span id="line-407"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156254"><span class="hs-identifier hs-var">core_arrow</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156253"><span class="hs-identifier hs-var">core_arg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156267"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-410"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156259"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156265"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-411"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XCmdArrApp (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156263"><span class="hs-identifier hs-var">arrow_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156255"><span class="hs-identifier hs-var">arg_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-412"></span><span>              </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156264"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-413"></span><span>              </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156251"><span class="hs-identifier hs-var">core_make_pair</span></a></span><span>
</span><span id="line-414"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_app"><span class="hs-identifier hs-var">do_app</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156267"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156255"><span class="hs-identifier hs-var">arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156264"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-415"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreExpr] -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprsFreeIdsDSet"><span class="hs-identifier hs-var">exprsFreeIdsDSet</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156254"><span class="hs-identifier hs-var">core_arrow</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156253"><span class="hs-identifier hs-var">core_arg</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-416"></span><span>              </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156266"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="hs-comment">-- D; ys |-a cmd : (t,stk) --&gt; t'</span><span>
</span><span id="line-419"></span><span class="hs-comment">-- D, xs |-  exp :: t</span><span>
</span><span id="line-420"></span><span class="hs-comment">-- ------------------------</span><span>
</span><span id="line-421"></span><span class="hs-comment">-- D; xs |-a cmd exp : stk --&gt; t'</span><span>
</span><span id="line-422"></span><span class="hs-comment">--</span><span>
</span><span id="line-423"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs),stk) -&gt; ((ys),(e,stk))) cmd</span><span>
</span><span id="line-424"></span><span>
</span><span id="line-425"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156249"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156249"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156248"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156248"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156247"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156247"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156246"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156246"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdApp"><span class="hs-identifier hs-type">HsCmdApp</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdApp (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156244"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156244"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span id="local-6989586621681156243"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156243"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156242"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156242"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-426"></span><span>    </span><span id="local-6989586621681156241"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156241"><span class="hs-identifier hs-var">core_arg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156243"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-427"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-428"></span><span>        </span><span id="local-6989586621681156240"><span class="annot"><span class="annottext">arg_ty :: Type
</span><a href="#local-6989586621681156240"><span class="hs-identifier hs-var hs-var">arg_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156241"><span class="hs-identifier hs-var">core_arg</span></a></span><span>
</span><span id="line-429"></span><span>        </span><span id="local-6989586621681156239"><span class="annot"><span class="annottext">stack_ty' :: Type
</span><a href="#local-6989586621681156239"><span class="hs-identifier hs-var hs-var">stack_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156240"><span class="hs-identifier hs-var">arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156247"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-430"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156238"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156238"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156237"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156237"><span class="hs-identifier hs-var">free_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156236"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156236"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-431"></span><span>             </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156249"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156248"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156239"><span class="hs-identifier hs-var">stack_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156246"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156244"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-432"></span><span>    </span><span id="local-6989586621681156235"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156235"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156247"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-433"></span><span>    </span><span id="local-6989586621681156234"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156234"><span class="hs-identifier hs-var">arg_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDsNoLP"><span class="hs-identifier hs-var">newSysLocalDsNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156240"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-434"></span><span>    </span><span class="hs-comment">-- push the argument expression onto the stack</span><span>
</span><span id="line-435"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-436"></span><span>        </span><span id="local-6989586621681156232"><span class="annot"><span class="annottext">stack' :: CoreExpr
</span><a href="#local-6989586621681156232"><span class="hs-identifier hs-var hs-var">stack'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156234"><span class="hs-identifier hs-var">arg_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156235"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-437"></span><span>        </span><span id="local-6989586621681156231"><span class="annot"><span class="annottext">core_body :: CoreExpr
</span><a href="#local-6989586621681156231"><span class="hs-identifier hs-var hs-var">core_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#bindNonRec"><span class="hs-identifier hs-var">bindNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156234"><span class="hs-identifier hs-var">arg_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156241"><span class="hs-identifier hs-var">core_arg</span></a></span><span>
</span><span id="line-438"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156236"><span class="hs-identifier hs-var">env_ids'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156232"><span class="hs-identifier hs-var">stack'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span>    </span><span class="hs-comment">-- match the environment and stack against the input</span><span>
</span><span id="line-441"></span><span>    </span><span id="local-6989586621681156229"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156229"><span class="hs-identifier hs-var">core_map</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156242"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156235"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156231"><span class="hs-identifier hs-var">core_body</span></a></span><span>
</span><span id="line-442"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156249"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-443"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156242"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156247"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156236"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156239"><span class="hs-identifier hs-var">stack_ty'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span>                      </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156246"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-446"></span><span>                      </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156229"><span class="hs-identifier hs-var">core_map</span></a></span><span>
</span><span id="line-447"></span><span>                      </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156238"><span class="hs-identifier hs-var">core_cmd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-448"></span><span>            </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156237"><span class="hs-identifier hs-var">free_vars</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSet"><span class="hs-operator hs-var">`unionDVarSet`</span></a></span><span>
</span><span id="line-449"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprFreeIdsDSet"><span class="hs-identifier hs-var">exprFreeIdsDSet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156241"><span class="hs-identifier hs-var">core_arg</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156248"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156227"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156227"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156226"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156226"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156225"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156225"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156224"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156224"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-452"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdLam"><span class="hs-identifier hs-type">HsCmdLam</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdLam (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span>
</span><span id="line-453"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681156218"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156218"><span class="hs-identifier hs-var">pats</span></a></span></span><span>
</span><span id="line-454"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681156214"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156214"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span>        </span><span id="local-6989586621681156213"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156213"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span>
</span><span id="line-456"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; [LPat (GhcPass 'Typechecked)]
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLam"><span class="hs-identifier hs-var">dsCmdLam</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156227"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156226"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156225"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156224"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156218"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156214"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156213"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156211"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156211"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156210"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156210"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156209"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156209"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156208"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156208"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdPar"><span class="hs-identifier hs-type">HsCmdPar</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdPar (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156206"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156206"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156205"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156205"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span>
</span><span id="line-459"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsLCmd"><span class="hs-identifier hs-var">dsLCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156211"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156210"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156209"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156208"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156206"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156205"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-460"></span><span>
</span><span id="line-461"></span><span class="hs-comment">-- D, xs |- e :: Bool</span><span>
</span><span id="line-462"></span><span class="hs-comment">-- D; xs1 |-a c1 : stk --&gt; t</span><span>
</span><span id="line-463"></span><span class="hs-comment">-- D; xs2 |-a c2 : stk --&gt; t</span><span>
</span><span id="line-464"></span><span class="hs-comment">-- ----------------------------------------</span><span>
</span><span id="line-465"></span><span class="hs-comment">-- D; xs |-a if e then c1 else c2 : stk --&gt; t</span><span>
</span><span id="line-466"></span><span class="hs-comment">--</span><span>
</span><span id="line-467"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs),stk) -&gt;</span><span>
</span><span id="line-468"></span><span class="hs-comment">--                       if e then Left ((xs1),stk) else Right ((xs2),stk))</span><span>
</span><span id="line-469"></span><span class="hs-comment">--                     (c1 ||| c2)</span><span>
</span><span id="line-470"></span><span>
</span><span id="line-471"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156204"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156204"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156203"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156203"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156202"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156201"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156201"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdIf"><span class="hs-identifier hs-type">HsCmdIf</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdIf (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156199"><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156199"><span class="hs-identifier hs-var">mb_fun</span></a></span></span><span> </span><span id="local-6989586621681156198"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156198"><span class="hs-identifier hs-var">cond</span></a></span></span><span> </span><span id="local-6989586621681156197"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156197"><span class="hs-identifier hs-var">then_cmd</span></a></span></span><span> </span><span id="local-6989586621681156196"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156196"><span class="hs-identifier hs-var">else_cmd</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-472"></span><span>        </span><span id="local-6989586621681156195"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156195"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-473"></span><span>    </span><span id="local-6989586621681156194"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156194"><span class="hs-identifier hs-var">core_cond</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156198"><span class="hs-identifier hs-var">cond</span></a></span><span>
</span><span id="line-474"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156193"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156193"><span class="hs-identifier hs-var">core_then</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156192"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156192"><span class="hs-identifier hs-var">fvs_then</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156191"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156191"><span class="hs-identifier hs-var">then_ids</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-475"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156204"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156203"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156201"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156197"><span class="hs-identifier hs-var">then_cmd</span></a></span><span>
</span><span id="line-476"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156190"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156190"><span class="hs-identifier hs-var">core_else</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156189"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156189"><span class="hs-identifier hs-var">fvs_else</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156188"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156188"><span class="hs-identifier hs-var">else_ids</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156204"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156203"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156201"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156196"><span class="hs-identifier hs-var">else_cmd</span></a></span><span>
</span><span id="line-478"></span><span>    </span><span id="local-6989586621681156187"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156187"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-479"></span><span>    </span><span id="local-6989586621681156186"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681156186"><span class="hs-identifier hs-var">either_con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM TyCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupTyCon"><span class="hs-identifier hs-var">dsLookupTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#eitherTyConName"><span class="hs-identifier hs-var">eitherTyConName</span></a></span><span>
</span><span id="line-480"></span><span>    </span><span id="local-6989586621681156183"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156183"><span class="hs-identifier hs-var">left_con</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM DataCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupDataCon"><span class="hs-identifier hs-var">dsLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#leftDataConName"><span class="hs-identifier hs-var">leftDataConName</span></a></span><span>
</span><span id="line-481"></span><span>    </span><span id="local-6989586621681156180"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156180"><span class="hs-identifier hs-var">right_con</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM DataCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupDataCon"><span class="hs-identifier hs-var">dsLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#rightDataConName"><span class="hs-identifier hs-var">rightDataConName</span></a></span><span>
</span><span id="line-482"></span><span>
</span><span id="line-483"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156178"><span class="annot"><span class="annottext">mk_left_expr :: Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681156178"><span class="hs-identifier hs-var hs-var">mk_left_expr</span></a></span></span><span> </span><span id="local-6989586621681156177"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156177"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681156176"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156176"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span id="local-6989586621681156175"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156175"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156183"><span class="hs-identifier hs-var">left_con</span></a></span><span>   </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156177"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156176"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156175"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-484"></span><span>        </span><span id="local-6989586621681156173"><span class="annot"><span class="annottext">mk_right_expr :: Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681156173"><span class="hs-identifier hs-var hs-var">mk_right_expr</span></a></span></span><span> </span><span id="local-6989586621681156172"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156172"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681156171"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156171"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span id="local-6989586621681156170"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156170"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156180"><span class="hs-identifier hs-var">right_con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156172"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156171"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156170"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-485"></span><span>
</span><span id="line-486"></span><span>        </span><span id="local-6989586621681156169"><span class="annot"><span class="annottext">in_ty :: Type
</span><a href="#local-6989586621681156169"><span class="hs-identifier hs-var hs-var">in_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156195"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-487"></span><span>        </span><span id="local-6989586621681156168"><span class="annot"><span class="annottext">then_ty :: Type
</span><a href="#local-6989586621681156168"><span class="hs-identifier hs-var hs-var">then_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156191"><span class="hs-identifier hs-var">then_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-488"></span><span>        </span><span id="local-6989586621681156167"><span class="annot"><span class="annottext">else_ty :: Type
</span><a href="#local-6989586621681156167"><span class="hs-identifier hs-var hs-var">else_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156188"><span class="hs-identifier hs-var">else_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156202"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-489"></span><span>        </span><span id="local-6989586621681156166"><span class="annot"><span class="annottext">sum_ty :: Type
</span><a href="#local-6989586621681156166"><span class="hs-identifier hs-var hs-var">sum_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681156186"><span class="hs-identifier hs-var">either_con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156168"><span class="hs-identifier hs-var">then_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156167"><span class="hs-identifier hs-var">else_ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-490"></span><span>        </span><span id="local-6989586621681156164"><span class="annot"><span class="annottext">fvs_cond :: DIdSet
</span><a href="#local-6989586621681156164"><span class="hs-identifier hs-var hs-var">fvs_cond</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprFreeIdsDSet"><span class="hs-identifier hs-var">exprFreeIdsDSet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156194"><span class="hs-identifier hs-var">core_cond</span></a></span><span>
</span><span id="line-491"></span><span>                   </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156203"><span class="hs-identifier hs-var">local_vars</span></a></span><span>
</span><span id="line-492"></span><span>
</span><span id="line-493"></span><span>        </span><span id="local-6989586621681156163"><span class="annot"><span class="annottext">core_left :: CoreExpr
</span><a href="#local-6989586621681156163"><span class="hs-identifier hs-var hs-var">core_left</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681156178"><span class="hs-identifier hs-var">mk_left_expr</span></a></span><span>  </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156168"><span class="hs-identifier hs-var">then_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156167"><span class="hs-identifier hs-var">else_ty</span></a></span><span>
</span><span id="line-494"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-var">buildEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156191"><span class="hs-identifier hs-var">then_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156187"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-495"></span><span>        </span><span id="local-6989586621681156162"><span class="annot"><span class="annottext">core_right :: CoreExpr
</span><a href="#local-6989586621681156162"><span class="hs-identifier hs-var hs-var">core_right</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681156173"><span class="hs-identifier hs-var">mk_right_expr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156168"><span class="hs-identifier hs-var">then_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156167"><span class="hs-identifier hs-var">else_ty</span></a></span><span>
</span><span id="line-496"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-var">buildEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156188"><span class="hs-identifier hs-var">else_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156187"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-497"></span><span>
</span><span id="line-498"></span><span>    </span><span id="local-6989586621681156161"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156161"><span class="hs-identifier hs-var">core_if</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156199"><span class="hs-identifier hs-var">mb_fun</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-499"></span><span>       </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
SyntaxExprTc
</span><a href="GHC.Hs.Expr.html#NoSyntaxExprTc"><span class="hs-identifier hs-var">NoSyntaxExprTc</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156195"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156187"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-500"></span><span>                          </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIfThenElse"><span class="hs-identifier hs-var">mkIfThenElse</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156194"><span class="hs-identifier hs-var">core_cond</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156163"><span class="hs-identifier hs-var">core_left</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156162"><span class="hs-identifier hs-var">core_right</span></a></span><span>
</span><span id="line-501"></span><span>       </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681156158"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156158"><span class="hs-identifier hs-var">fun_apps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked) -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156199"><span class="hs-identifier hs-var">mb_fun</span></a></span><span>
</span><span id="line-502"></span><span>                                      </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156194"><span class="hs-identifier hs-var">core_cond</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156163"><span class="hs-identifier hs-var">core_left</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156162"><span class="hs-identifier hs-var">core_right</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-503"></span><span>               </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156195"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156187"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156158"><span class="hs-identifier hs-var">fun_apps</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-504"></span><span>
</span><span id="line-505"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156204"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156169"><span class="hs-identifier hs-var">in_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156166"><span class="hs-identifier hs-var">sum_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156201"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-506"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156161"><span class="hs-identifier hs-var">core_if</span></a></span><span>
</span><span id="line-507"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_choice"><span class="hs-identifier hs-var">do_choice</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156204"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156168"><span class="hs-identifier hs-var">then_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156167"><span class="hs-identifier hs-var">else_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156201"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156193"><span class="hs-identifier hs-var">core_then</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156190"><span class="hs-identifier hs-var">core_else</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-508"></span><span>        </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156164"><span class="hs-identifier hs-var">fvs_cond</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSet"><span class="hs-operator hs-var">`unionDVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156192"><span class="hs-identifier hs-var">fvs_then</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSet"><span class="hs-operator hs-var">`unionDVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156189"><span class="hs-identifier hs-var">fvs_else</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-509"></span><span>
</span><span id="line-510"></span><span class="hs-comment">{-
Case commands are treated in much the same way as if commands
(see above) except that there are more alternatives.  For example

        case e of { p1 -&gt; c1; p2 -&gt; c2; p3 -&gt; c3 }

is translated to

        premap (\ ((xs)*ts) -&gt; case e of
                p1 -&gt; (Left (Left (xs1)*ts))
                p2 -&gt; Left ((Right (xs2)*ts))
                p3 -&gt; Right ((xs3)*ts))
        ((c1 ||| c2) ||| c3)

The idea is to extract the commands from the case, build a balanced tree
of choices, and replace the commands with expressions that build tagged
tuples, obtaining a case expression that can be desugared normally.
To build all this, we use triples describing segments of the list of
case bodies, containing the following fields:
 * a list of expressions of the form (Left|Right)* ((xs)*ts), to be put
   into the case replacing the commands
 * a sum type that is the common type of these expressions, and also the
   input type of the arrow
 * a CoreExpr for an arrow built by combining the translated command
   bodies with |||.
-}</span><span>
</span><span id="line-536"></span><span>
</span><span id="line-537"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156157"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156157"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156156"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156156"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156155"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156155"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156154"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156154"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-538"></span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdCase"><span class="hs-identifier hs-type">HsCmdCase</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdCase (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156152"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156152"><span class="hs-identifier hs-var">exp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681156151"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681156151"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681156150"><span class="annot"><span class="annottext">[LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681156150"><span class="hs-identifier hs-var">matches</span></a></span></span><span>
</span><span id="line-539"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: forall p body. MatchGroup p body -&gt; XMG p body
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-type">MatchGroupTc</span></a></span><span> </span><span id="local-6989586621681156147"><span class="annot"><span class="annottext">[Scaled Type]
</span><a href="#local-6989586621681156147"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-540"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: forall p body. MatchGroup p body -&gt; Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681156145"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681156145"><span class="hs-identifier hs-var">origin</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-541"></span><span>      </span><span id="local-6989586621681156144"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156144"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-542"></span><span>    </span><span id="local-6989586621681156143"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156143"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156155"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span>    </span><span class="hs-comment">-- Extract and desugar the leaf commands in the case, building tuple</span><span>
</span><span id="line-545"></span><span>    </span><span class="hs-comment">-- expressions that will (after tagging) replace these leaves</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-548"></span><span>        </span><span id="local-6989586621681156142"><span class="annot"><span class="annottext">leaves :: [(LHsCmd (GhcPass 'Typechecked), VarSet)]
</span><a href="#local-6989586621681156142"><span class="hs-identifier hs-var hs-var">leaves</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
 -&gt; [(LHsCmd (GhcPass 'Typechecked), VarSet)])
-&gt; [LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))]
-&gt; [(LHsCmd (GhcPass 'Typechecked), VarSet)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
-&gt; [(LHsCmd (GhcPass 'Typechecked), VarSet)]
forall (body :: * -&gt; *).
LMatch
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; [(Located (body (GhcPass 'Typechecked)), VarSet)]
</span><a href="GHC.HsToCore.Arrows.html#leavesMatch"><span class="hs-identifier hs-var">leavesMatch</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681156150"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-549"></span><span>        </span><span id="local-6989586621681156139"><span class="annot"><span class="annottext">make_branch :: (LHsCmd (GhcPass 'Typechecked), VarSet)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
</span><a href="#local-6989586621681156139"><span class="hs-identifier hs-var hs-var">make_branch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681156138"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156138"><span class="hs-identifier hs-var">leaf</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156137"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156137"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-550"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681156136"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156136"><span class="hs-identifier hs-var">core_leaf</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156135"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156135"><span class="hs-identifier hs-var">_fvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156134"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156134"><span class="hs-identifier hs-var">leaf_ids</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-551"></span><span>               </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156157"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156137"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156156"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156155"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-552"></span><span>                    </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156154"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156138"><span class="hs-identifier hs-var">leaf</span></a></span><span>
</span><span id="line-553"></span><span>            </span><span class="annot"><span class="annottext">([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; LHsExpr (GhcPass 'Typechecked)
</span><a href="GHC.HsToCore.Arrows.html#mkHsEnvStackExpr"><span class="hs-identifier hs-var">mkHsEnvStackExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156134"><span class="hs-identifier hs-var">leaf_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156143"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-554"></span><span>                    </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156134"><span class="hs-identifier hs-var">leaf_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156155"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-555"></span><span>                    </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156136"><span class="hs-identifier hs-var">core_leaf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span>    </span><span id="local-6989586621681156132"><span class="annot"><span class="annottext">[([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)]
</span><a href="#local-6989586621681156132"><span class="hs-identifier hs-var">branches</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((LHsCmd (GhcPass 'Typechecked), VarSet)
 -&gt; IOEnv
      (Env DsGblEnv DsLclEnv)
      ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr))
-&gt; [(LHsCmd (GhcPass 'Typechecked), VarSet)]
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     [([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsCmd (GhcPass 'Typechecked), VarSet)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
</span><a href="#local-6989586621681156139"><span class="hs-identifier hs-var">make_branch</span></a></span><span> </span><span class="annot"><span class="annottext">[(LHsCmd (GhcPass 'Typechecked), VarSet)]
</span><a href="#local-6989586621681156142"><span class="hs-identifier hs-var">leaves</span></a></span><span>
</span><span id="line-558"></span><span>    </span><span id="local-6989586621681156130"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681156130"><span class="hs-identifier hs-var">either_con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM TyCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupTyCon"><span class="hs-identifier hs-var">dsLookupTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#eitherTyConName"><span class="hs-identifier hs-var">eitherTyConName</span></a></span><span>
</span><span id="line-559"></span><span>    </span><span id="local-6989586621681156129"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156129"><span class="hs-identifier hs-var">left_con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM DataCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupDataCon"><span class="hs-identifier hs-var">dsLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#leftDataConName"><span class="hs-identifier hs-var">leftDataConName</span></a></span><span>
</span><span id="line-560"></span><span>    </span><span id="local-6989586621681156128"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156128"><span class="hs-identifier hs-var">right_con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM DataCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupDataCon"><span class="hs-identifier hs-var">dsLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#rightDataConName"><span class="hs-identifier hs-var">rightDataConName</span></a></span><span>
</span><span id="line-561"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-562"></span><span>        </span><span id="local-6989586621681156127"><span class="annot"><span class="annottext">left_id :: HsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156127"><span class="hs-identifier hs-var hs-var">left_id</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XConLikeOut (GhcPass 'Typechecked)
-&gt; ConLike -&gt; HsExpr (GhcPass 'Typechecked)
forall p. XConLikeOut p -&gt; ConLike -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsConLikeOut"><span class="hs-identifier hs-var">HsConLikeOut</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XConLikeOut (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; ConLike
</span><a href="GHC.Core.ConLike.html#RealDataCon"><span class="hs-identifier hs-var">RealDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156129"><span class="hs-identifier hs-var">left_con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-563"></span><span>        </span><span id="local-6989586621681156123"><span class="annot"><span class="annottext">right_id :: HsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156123"><span class="hs-identifier hs-var hs-var">right_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XConLikeOut (GhcPass 'Typechecked)
-&gt; ConLike -&gt; HsExpr (GhcPass 'Typechecked)
forall p. XConLikeOut p -&gt; ConLike -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsConLikeOut"><span class="hs-identifier hs-var">HsConLikeOut</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XConLikeOut (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; ConLike
</span><a href="GHC.Core.ConLike.html#RealDataCon"><span class="hs-identifier hs-var">RealDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681156128"><span class="hs-identifier hs-var">right_con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span>        </span><span id="local-6989586621681156122"><span class="annot"><span class="annottext">left_expr :: Type
-&gt; Type
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156122"><span class="hs-identifier hs-var hs-var">left_expr</span></a></span></span><span>  </span><span id="local-6989586621681156121"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156121"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681156120"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156120"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span id="local-6989586621681156119"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156119"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked))
-&gt; HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XApp (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; HsExpr (GhcPass 'Typechecked)
forall p. XApp p -&gt; LHsExpr p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-var">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XApp (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-565"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked))
-&gt; HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
-&gt; HsExpr (GhcPass 'Typechecked) -&gt; HsExpr (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Utils.html#mkHsWrap"><span class="hs-identifier hs-var">mkHsWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpTyApps"><span class="hs-identifier hs-var">mkWpTyApps</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156121"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156120"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156127"><span class="hs-identifier hs-var">left_id</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156119"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-566"></span><span>        </span><span id="local-6989586621681156114"><span class="annot"><span class="annottext">right_expr :: Type
-&gt; Type
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156114"><span class="hs-identifier hs-var hs-var">right_expr</span></a></span></span><span> </span><span id="local-6989586621681156113"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156113"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681156112"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156112"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span id="local-6989586621681156111"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156111"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked))
-&gt; HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XApp (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; HsExpr (GhcPass 'Typechecked)
forall p. XApp p -&gt; LHsExpr p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-var">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XApp (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-567"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked))
-&gt; HsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
-&gt; HsExpr (GhcPass 'Typechecked) -&gt; HsExpr (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Utils.html#mkHsWrap"><span class="hs-identifier hs-var">mkHsWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpTyApps"><span class="hs-identifier hs-var">mkWpTyApps</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156113"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156112"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156123"><span class="hs-identifier hs-var">right_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156111"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-568"></span><span>
</span><span id="line-569"></span><span>        </span><span class="hs-comment">-- Prefix each tuple with a distinct series of Left's and Right's,</span><span>
</span><span id="line-570"></span><span>        </span><span class="hs-comment">-- in a balanced way, keeping track of the types.</span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span>        </span><span id="local-6989586621681156110"><span class="annot"><span class="annottext">merge_branches :: ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
-&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
-&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
</span><a href="#local-6989586621681156110"><span class="hs-identifier hs-var hs-var">merge_branches</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681156109"><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156109"><span class="hs-identifier hs-var">builds1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156108"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156108"><span class="hs-identifier hs-var">in_ty1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156107"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156107"><span class="hs-identifier hs-var">core_exp1</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-573"></span><span>                       </span><span class="hs-special">(</span><span id="local-6989586621681156106"><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156106"><span class="hs-identifier hs-var">builds2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156105"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156105"><span class="hs-identifier hs-var">in_ty2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156104"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156104"><span class="hs-identifier hs-var">core_exp2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-574"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LHsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked))
-&gt; [LHsExpr (GhcPass 'Typechecked)]
-&gt; [LHsExpr (GhcPass 'Typechecked)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
-&gt; Type
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156122"><span class="hs-identifier hs-var">left_expr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156108"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156105"><span class="hs-identifier hs-var">in_ty2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156109"><span class="hs-identifier hs-var">builds1</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
-&gt; [LHsExpr (GhcPass 'Typechecked)]
-&gt; [LHsExpr (GhcPass 'Typechecked)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-575"></span><span>                </span><span class="annot"><span class="annottext">(LHsExpr (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked))
-&gt; [LHsExpr (GhcPass 'Typechecked)]
-&gt; [LHsExpr (GhcPass 'Typechecked)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
-&gt; Type
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156114"><span class="hs-identifier hs-var">right_expr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156108"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156105"><span class="hs-identifier hs-var">in_ty2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156106"><span class="hs-identifier hs-var">builds2</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-576"></span><span>             </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681156130"><span class="hs-identifier hs-var">either_con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156108"><span class="hs-identifier hs-var">in_ty1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156105"><span class="hs-identifier hs-var">in_ty2</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-577"></span><span>             </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_choice"><span class="hs-identifier hs-var">do_choice</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156157"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156108"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156105"><span class="hs-identifier hs-var">in_ty2</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156154"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156107"><span class="hs-identifier hs-var">core_exp1</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156104"><span class="hs-identifier hs-var">core_exp2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-578"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681156103"><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156103"><span class="hs-identifier hs-var">leaves'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156102"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156102"><span class="hs-identifier hs-var">sum_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156101"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156101"><span class="hs-identifier hs-var">core_choices</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
 -&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
 -&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr))
-&gt; [([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)]
-&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
forall a. (a -&gt; a -&gt; a) -&gt; [a] -&gt; a
</span><a href="GHC.HsToCore.Arrows.html#foldb"><span class="hs-identifier hs-var">foldb</span></a></span><span> </span><span class="annot"><span class="annottext">([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
-&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
-&gt; ([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)
</span><a href="#local-6989586621681156110"><span class="hs-identifier hs-var">merge_branches</span></a></span><span> </span><span class="annot"><span class="annottext">[([LHsExpr (GhcPass 'Typechecked)], Type, CoreExpr)]
</span><a href="#local-6989586621681156132"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-579"></span><span>
</span><span id="line-580"></span><span>        </span><span class="hs-comment">-- Replace the commands in the case with these tagged tuples,</span><span>
</span><span id="line-581"></span><span>        </span><span class="hs-comment">-- yielding a HsExpr Id we can feed to dsExpr.</span><span>
</span><span id="line-582"></span><span>
</span><span id="line-583"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156099"><span class="annot"><span class="annottext">[LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681156099"><span class="hs-identifier hs-var">matches'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([LHsExpr (GhcPass 'Typechecked)]
 -&gt; LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
 -&gt; ([LHsExpr (GhcPass 'Typechecked)],
     LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))))
-&gt; [LHsExpr (GhcPass 'Typechecked)]
-&gt; [LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))]
-&gt; ([LHsExpr (GhcPass 'Typechecked)],
    [LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
-&gt; [LHsExpr (GhcPass 'Typechecked)]
-&gt; LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
-&gt; ([LHsExpr (GhcPass 'Typechecked)],
    LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked)))
forall (body' :: * -&gt; *) (body :: * -&gt; *).
Type
-&gt; [Located (body' (GhcPass 'Typechecked))]
-&gt; LMatch
     (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    LMatch
      (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
</span><a href="GHC.HsToCore.Arrows.html#replaceLeavesMatch"><span class="hs-identifier hs-var">replaceLeavesMatch</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156154"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156103"><span class="hs-identifier hs-var">leaves'</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681156150"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-584"></span><span>        </span><span id="local-6989586621681156096"><span class="annot"><span class="annottext">in_ty :: Type
</span><a href="#local-6989586621681156096"><span class="hs-identifier hs-var hs-var">in_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156144"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156155"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span>    </span><span id="local-6989586621681156095"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156095"><span class="hs-identifier hs-var">core_body</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCase (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; MatchGroup
     (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))
-&gt; HsExpr (GhcPass 'Typechecked)
forall p.
XCase p -&gt; LHsExpr p -&gt; MatchGroup p (LHsExpr p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsCase"><span class="hs-identifier hs-var">HsCase</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCase (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156152"><span class="hs-identifier hs-var">exp</span></a></span><span>
</span><span id="line-587"></span><span>                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located
  [LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))]
-&gt; Located
     [LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681156151"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681156099"><span class="hs-identifier hs-var">matches'</span></a></span><span>
</span><span id="line-588"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG (GhcPass 'Typechecked) (LHsExpr (GhcPass 'Typechecked))
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled Type] -&gt; Type -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Type]
</span><a href="#local-6989586621681156147"><span class="hs-identifier hs-var">arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156102"><span class="hs-identifier hs-var">sum_ty</span></a></span><span>
</span><span id="line-589"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681156145"><span class="hs-identifier hs-var">origin</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-590"></span><span>        </span><span class="hs-comment">-- Note that we replace the HsCase result type by sum_ty,</span><span>
</span><span id="line-591"></span><span>        </span><span class="hs-comment">-- which is the type of matches'</span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span>    </span><span id="local-6989586621681156093"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156093"><span class="hs-identifier hs-var">core_matches</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156144"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156143"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156095"><span class="hs-identifier hs-var">core_body</span></a></span><span>
</span><span id="line-594"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156157"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156096"><span class="hs-identifier hs-var">in_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156102"><span class="hs-identifier hs-var">sum_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156154"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156093"><span class="hs-identifier hs-var">core_matches</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156101"><span class="hs-identifier hs-var">core_choices</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-595"></span><span>            </span><span class="annot"><span class="annottext">CoreExpr -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprFreeIdsDSet"><span class="hs-identifier hs-var">exprFreeIdsDSet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156095"><span class="hs-identifier hs-var">core_body</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156156"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156092"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156092"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156091"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156091"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156090"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156090"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156089"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156089"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-598"></span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdLamCase"><span class="hs-identifier hs-type">HsCmdLamCase</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdLamCase (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156087"><span class="annot"><span class="annottext">mg :: MatchGroup (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681156087"><span class="hs-identifier hs-var">mg</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_ext :: forall p body. MatchGroup p body -&gt; XMG p body
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-type">MatchGroupTc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span id="local-6989586621681156085"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156085"><span class="hs-identifier hs-var">arg_mult</span></a></span></span><span> </span><span id="local-6989586621681156084"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156084"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156083"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156083"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-599"></span><span>  </span><span id="local-6989586621681156082"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156082"><span class="hs-identifier hs-var">arg_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156085"><span class="hs-identifier hs-var">arg_mult</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156084"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-600"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156081"><span class="annot"><span class="annottext">case_cmd :: LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156081"><span class="hs-identifier hs-var hs-var">case_cmd</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked) -&gt; LHsCmd (GhcPass 'Typechecked)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsCmd (GhcPass 'Typechecked) -&gt; LHsCmd (GhcPass 'Typechecked))
-&gt; HsCmd (GhcPass 'Typechecked) -&gt; LHsCmd (GhcPass 'Typechecked)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>&#160;</span><span class="annot"><span class="annottext">XCmdCase (GhcPass 'Typechecked)
-&gt; LHsExpr (GhcPass 'Typechecked)
-&gt; MatchGroup
     (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
-&gt; HsCmd (GhcPass 'Typechecked)
forall id.
XCmdCase id -&gt; LHsExpr id -&gt; MatchGroup id (LHsCmd id) -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdCase"><span class="hs-identifier hs-var">HsCmdCase</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCmdCase (GhcPass 'Typechecked)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdP (GhcPass 'Typechecked) -&gt; LHsExpr (GhcPass 'Typechecked)
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156082"><span class="hs-identifier hs-var">arg_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MatchGroup (GhcPass 'Typechecked) (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681156087"><span class="hs-identifier hs-var">mg</span></a></span><span>
</span><span id="line-601"></span><span>  </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; [LPat (GhcPass 'Typechecked)]
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLam"><span class="hs-identifier hs-var">dsCmdLam</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156092"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156091"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156090"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156089"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">IdP (GhcPass 'Typechecked) -&gt; LPat (GhcPass 'Typechecked)
forall (id :: Pass). IdP (GhcPass id) -&gt; LPat (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlVarPat"><span class="hs-identifier hs-var">nlVarPat</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156082"><span class="hs-identifier hs-var">arg_id</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156081"><span class="hs-identifier hs-var">case_cmd</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156083"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-602"></span><span>
</span><span id="line-603"></span><span class="hs-comment">-- D; ys |-a cmd : stk --&gt; t</span><span>
</span><span id="line-604"></span><span class="hs-comment">-- ----------------------------------</span><span>
</span><span id="line-605"></span><span class="hs-comment">-- D; xs |-a let binds in cmd : stk --&gt; t</span><span>
</span><span id="line-606"></span><span class="hs-comment">--</span><span>
</span><span id="line-607"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs),stk) -&gt; let binds in ((ys),stk)) c</span><span>
</span><span id="line-608"></span><span>
</span><span id="line-609"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156079"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156079"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156078"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156078"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156077"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156077"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156076"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156076"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdLet"><span class="hs-identifier hs-type">HsCmdLet</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdLet (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156074"><span class="annot"><span class="annottext">lbinds :: LHsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156074"><span class="hs-identifier hs-var">lbinds</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156073"><span class="annot"><span class="annottext">HsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156073"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156072"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156072"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-610"></span><span>                                                                    </span><span id="local-6989586621681156071"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156071"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-611"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-612"></span><span>        </span><span id="local-6989586621681156070"><span class="annot"><span class="annottext">defined_vars :: VarSet
</span><a href="#local-6989586621681156070"><span class="hs-identifier hs-var hs-var">defined_vars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsLocalBinds (GhcPass 'Typechecked) -&gt; [IdP (GhcPass 'Typechecked)]
forall (idL :: Pass) (idR :: Pass).
CollectPass (GhcPass idL) =&gt;
HsLocalBindsLR (GhcPass idL) (GhcPass idR) -&gt; [IdP (GhcPass idL)]
</span><a href="GHC.Hs.Utils.html#collectLocalBinders"><span class="hs-identifier hs-var">collectLocalBinders</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156073"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-613"></span><span>        </span><span id="local-6989586621681156068"><span class="annot"><span class="annottext">local_vars' :: VarSet
</span><a href="#local-6989586621681156068"><span class="hs-identifier hs-var hs-var">local_vars'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156070"><span class="hs-identifier hs-var">defined_vars</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156078"><span class="hs-identifier hs-var">local_vars</span></a></span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156067"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156067"><span class="hs-identifier hs-var">core_body</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156066"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156066"><span class="hs-identifier hs-var">_free_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156065"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156065"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-616"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156079"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156068"><span class="hs-identifier hs-var">local_vars'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156077"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156076"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156072"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-617"></span><span>    </span><span id="local-6989586621681156064"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156064"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156077"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-618"></span><span>    </span><span class="hs-comment">-- build a new environment, plus the stack, using the let bindings</span><span>
</span><span id="line-619"></span><span>    </span><span id="local-6989586621681156063"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156063"><span class="hs-identifier hs-var">core_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked) -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156074"><span class="hs-identifier hs-var">lbinds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-var">buildEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156065"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156064"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-620"></span><span>    </span><span class="hs-comment">-- match the old environment and stack against the input</span><span>
</span><span id="line-621"></span><span>    </span><span id="local-6989586621681156062"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156062"><span class="hs-identifier hs-var">core_map</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156071"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156064"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156063"><span class="hs-identifier hs-var">core_binds</span></a></span><span>
</span><span id="line-622"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156079"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-623"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156071"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156077"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-624"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156065"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156077"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-625"></span><span>                        </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156076"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-626"></span><span>                        </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156062"><span class="hs-identifier hs-var">core_map</span></a></span><span>
</span><span id="line-627"></span><span>                        </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156067"><span class="hs-identifier hs-var">core_body</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-628"></span><span>        </span><span class="annot"><span class="annottext">CoreExpr -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprFreeIdsDSet"><span class="hs-identifier hs-var">exprFreeIdsDSet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156063"><span class="hs-identifier hs-var">core_binds</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156078"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-629"></span><span>
</span><span id="line-630"></span><span class="hs-comment">-- D; xs |-a ss : t</span><span>
</span><span id="line-631"></span><span class="hs-comment">-- ----------------------------------</span><span>
</span><span id="line-632"></span><span class="hs-comment">-- D; xs |-a do { ss } : () --&gt; t</span><span>
</span><span id="line-633"></span><span class="hs-comment">--</span><span>
</span><span id="line-634"></span><span class="hs-comment">--              ---&gt; premap (\ (env,stk) -&gt; env) c</span><span>
</span><span id="line-635"></span><span>
</span><span id="line-636"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156061"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156061"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156060"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156060"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156059"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156059"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156058"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156058"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681156057"><span class="annot"><span class="annottext">do_block :: HsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156057"><span class="hs-identifier hs-var">do_block</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdDo"><span class="hs-identifier hs-type">HsCmdDo</span></a></span><span> </span><span id="local-6989586621681156055"><span class="annot"><span class="annottext">XCmdDo (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156055"><span class="hs-identifier hs-var">stmts_ty</span></a></span></span><span>
</span><span id="line-637"></span><span>                                               </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681156054"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681156054"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681156053"><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156053"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-638"></span><span>                                                                   </span><span id="local-6989586621681156052"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156052"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-639"></span><span>    </span><span class="annot"><span class="annottext">SrcSpan -&gt; DsM () -&gt; DsM ()
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681156054"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM () -&gt; DsM ()) -&gt; DsM () -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-640"></span><span>      </span><span class="annot"><span class="annottext">Type -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPoly"><span class="hs-identifier hs-var">dsNoLevPoly</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XCmdDo (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156055"><span class="hs-identifier hs-var">stmts_ty</span></a></span><span>
</span><span id="line-641"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the do-command:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156057"><span class="hs-identifier hs-var">do_block</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-642"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156050"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156050"><span class="hs-identifier hs-var">core_stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156049"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156049"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdDo"><span class="hs-identifier hs-var">dsCmdDo</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156061"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156060"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156058"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156053"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156052"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-643"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156047"><span class="annot"><span class="annottext">env_ty :: Type
</span><a href="#local-6989586621681156047"><span class="hs-identifier hs-var hs-var">env_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156052"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-644"></span><span>    </span><span id="local-6989586621681156046"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156046"><span class="hs-identifier hs-var">core_fst</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkFstExpr"><span class="hs-identifier hs-var">mkFstExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156047"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156059"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-645"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156061"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-646"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156047"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156059"><span class="hs-identifier hs-var">stack_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-647"></span><span>                </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156047"><span class="hs-identifier hs-var">env_ty</span></a></span><span>
</span><span id="line-648"></span><span>                </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156058"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-649"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156046"><span class="hs-identifier hs-var">core_fst</span></a></span><span>
</span><span id="line-650"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156050"><span class="hs-identifier hs-var">core_stmts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-651"></span><span>        </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156049"><span class="hs-identifier hs-var">env_ids'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-652"></span><span>
</span><span id="line-653"></span><span class="hs-comment">-- D |- e :: forall e. a1 (e,stk1) t1 -&gt; ... an (e,stkn) tn -&gt; a (e,stk) t</span><span>
</span><span id="line-654"></span><span class="hs-comment">-- D; xs |-a ci :: stki --&gt; ti</span><span>
</span><span id="line-655"></span><span class="hs-comment">-- -----------------------------------</span><span>
</span><span id="line-656"></span><span class="hs-comment">-- D; xs |-a (|e c1 ... cn|) :: stk --&gt; t       ---&gt; e [t_xs] c1 ... cn</span><span>
</span><span id="line-657"></span><span>
</span><span id="line-658"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156045"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156045"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156044"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156044"><span class="hs-identifier hs-var">_stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156043"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156043"><span class="hs-identifier hs-var">_res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdArrForm"><span class="hs-identifier hs-type">HsCmdArrForm</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdArrForm (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156041"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156041"><span class="hs-identifier hs-var">op</span></a></span></span><span> </span><span class="annot"><span class="annottext">LexicalFixity
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe Fixity
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156040"><span class="annot"><span class="annottext">[LHsCmdTop (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156040"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156039"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156039"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-659"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681156038"><span class="annot"><span class="annottext">env_ty :: Type
</span><a href="#local-6989586621681156038"><span class="hs-identifier hs-var hs-var">env_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156039"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-660"></span><span>    </span><span id="local-6989586621681156037"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156037"><span class="hs-identifier hs-var">core_op</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156041"><span class="hs-identifier hs-var">op</span></a></span><span>
</span><span id="line-661"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156036"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681156036"><span class="hs-identifier hs-var">core_args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156035"><span class="annot"><span class="annottext">[DIdSet]
</span><a href="#local-6989586621681156035"><span class="hs-identifier hs-var">fv_sets</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsCmdTop (GhcPass 'Typechecked) -&gt; DsM (CoreExpr, DIdSet))
-&gt; [LHsCmdTop (GhcPass 'Typechecked)]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ([CoreExpr], [DIdSet])
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; m (b, c)) -&gt; [a] -&gt; m ([b], [c])
</span><a href="../../base/src/Control.Monad.html#mapAndUnzipM"><span class="hs-identifier hs-var">mapAndUnzipM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">VarSet
-&gt; [Id]
-&gt; LHsCmdTop (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsTrimCmdArg"><span class="hs-identifier hs-var">dsTrimCmdArg</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156045"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156039"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsCmdTop (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681156040"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-662"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156037"><span class="hs-identifier hs-var">core_op</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156038"><span class="hs-identifier hs-var">env_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681156036"><span class="hs-identifier hs-var">core_args</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-663"></span><span>            </span><span class="annot"><span class="annottext">[DIdSet] -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSets"><span class="hs-identifier hs-var">unionDVarSets</span></a></span><span> </span><span class="annot"><span class="annottext">[DIdSet]
</span><a href="#local-6989586621681156035"><span class="hs-identifier hs-var">fv_sets</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-664"></span><span>
</span><span id="line-665"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span id="local-6989586621681156031"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156031"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156030"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156030"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156029"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156029"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156028"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156028"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#XCmd"><span class="hs-identifier hs-type">XCmd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsWrap"><span class="hs-identifier hs-type">HsWrap</span></a></span><span> </span><span id="local-6989586621681156025"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681156025"><span class="hs-identifier hs-var">wrap</span></a></span></span><span> </span><span id="local-6989586621681156024"><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156024"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156023"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156023"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-666"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156022"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156022"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156021"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156021"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; HsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156031"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156030"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156029"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156028"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156024"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156023"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-667"></span><span>    </span><span id="local-6989586621681156020"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681156020"><span class="hs-identifier hs-var">core_wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681156025"><span class="hs-identifier hs-var">wrap</span></a></span><span>
</span><span id="line-668"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681156020"><span class="hs-identifier hs-var">core_wrap</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156022"><span class="hs-identifier hs-var">core_cmd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156021"><span class="hs-identifier hs-var">env_ids'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-669"></span><span>
</span><span id="line-670"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmd"><span class="hs-identifier hs-var">dsCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681156019"><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156019"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DsM (CoreExpr, DIdSet)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsCmd&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156019"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span class="hs-comment">-- D; ys |-a c : stk --&gt; t      (ys &lt;= xs)</span><span>
</span><span id="line-673"></span><span class="hs-comment">-- ---------------------</span><span>
</span><span id="line-674"></span><span class="hs-comment">-- D; xs |-a c : stk --&gt; t      ---&gt; premap (\ ((xs),stk) -&gt; ((ys),stk)) c</span><span>
</span><span id="line-675"></span><span>
</span><span id="line-676"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsTrimCmdArg"><span class="hs-identifier hs-type">dsTrimCmdArg</span></a></span><span>
</span><span id="line-677"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this command</span><span>
</span><span id="line-678"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>           </span><span class="hs-comment">-- list of vars in the input to this command</span><span>
</span><span id="line-679"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>       </span><span class="hs-comment">-- command argument to desugar</span><span>
</span><span id="line-680"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-681"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-682"></span><span id="dsTrimCmdArg"><span class="annot"><span class="annottext">dsTrimCmdArg :: VarSet
-&gt; [Id]
-&gt; LHsCmdTop (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsTrimCmdArg"><span class="hs-identifier hs-var hs-var">dsTrimCmdArg</span></a></span></span><span> </span><span id="local-6989586621681156018"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156018"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156017"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156017"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span>
</span><span id="line-683"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdTop"><span class="hs-identifier hs-type">HsCmdTop</span></a></span><span>
</span><span id="line-684"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#CmdTopTc"><span class="hs-identifier hs-type">CmdTopTc</span></a></span><span> </span><span id="local-6989586621681156016"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156016"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681156015"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156015"><span class="hs-identifier hs-var">cmd_ty</span></a></span></span><span> </span><span id="local-6989586621681156014"><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156014"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681156013"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156013"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-685"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156012"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681156012"><span class="hs-identifier hs-var">meth_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156011"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156011"><span class="hs-identifier hs-var">meth_ids</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked) -&gt; DsM ([CoreBind], DsCmdEnv)
</span><a href="GHC.HsToCore.Arrows.html#mkCmdEnv"><span class="hs-identifier hs-var">mkCmdEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CmdSyntaxTable (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156014"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-686"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681156010"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156010"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156009"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156009"><span class="hs-identifier hs-var">free_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681156008"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156008"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-687"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156011"><span class="hs-identifier hs-var">meth_ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156018"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156016"><span class="hs-identifier hs-var">stack_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156015"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681156013"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-688"></span><span>    </span><span id="local-6989586621681156007"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156007"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156016"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-689"></span><span>    </span><span id="local-6989586621681156006"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156006"><span class="hs-identifier hs-var">trim_code</span></a></span></span><span>
</span><span id="line-690"></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156017"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156007"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-var">buildEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156008"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681156007"><span class="hs-identifier hs-var">stack_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-691"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-692"></span><span>        </span><span id="local-6989586621681156005"><span class="annot"><span class="annottext">in_ty :: Type
</span><a href="#local-6989586621681156005"><span class="hs-identifier hs-var hs-var">in_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156017"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156016"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-693"></span><span>        </span><span id="local-6989586621681156004"><span class="annot"><span class="annottext">in_ty' :: Type
</span><a href="#local-6989586621681156004"><span class="hs-identifier hs-var hs-var">in_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156008"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156016"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-694"></span><span>        </span><span id="local-6989586621681156003"><span class="annot"><span class="annottext">arg_code :: CoreExpr
</span><a href="#local-6989586621681156003"><span class="hs-identifier hs-var hs-var">arg_code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156008"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681156017"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156010"><span class="hs-identifier hs-var">core_cmd</span></a></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-695"></span><span>                </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156011"><span class="hs-identifier hs-var">meth_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156005"><span class="hs-identifier hs-var">in_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156004"><span class="hs-identifier hs-var">in_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156015"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156006"><span class="hs-identifier hs-var">trim_code</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156010"><span class="hs-identifier hs-var">core_cmd</span></a></span><span>
</span><span id="line-696"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreBind] -&gt; CoreExpr -&gt; CoreExpr
forall b. [Bind b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLets"><span class="hs-identifier hs-var">mkLets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681156012"><span class="hs-identifier hs-var">meth_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681156003"><span class="hs-identifier hs-var">arg_code</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681156009"><span class="hs-identifier hs-var">free_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-697"></span><span>
</span><span id="line-698"></span><span class="hs-comment">-- Given D; xs |-a c : stk --&gt; t, builds c with xs fed back.</span><span>
</span><span id="line-699"></span><span class="hs-comment">-- Typically needs to be prefixed with arr (\(p, stk) -&gt; ((xs),stk))</span><span>
</span><span id="line-700"></span><span>
</span><span id="line-701"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-type">dsfixCmd</span></a></span><span>
</span><span id="line-702"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-703"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this command</span><span>
</span><span id="line-704"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                 </span><span class="hs-comment">-- type of the stack (right-nested tuple)</span><span>
</span><span id="line-705"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                 </span><span class="hs-comment">-- return type of the command</span><span>
</span><span id="line-706"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>         </span><span class="hs-comment">-- command to desugar</span><span>
</span><span id="line-707"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-708"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-709"></span><span>                </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- the same local vars as a list, fed back</span><span>
</span><span id="line-710"></span><span id="dsfixCmd"><span class="annot"><span class="annottext">dsfixCmd :: DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var hs-var">dsfixCmd</span></a></span></span><span> </span><span id="local-6989586621681156002"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156002"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681156001"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156001"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681156000"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156000"><span class="hs-identifier hs-var">stk_ty</span></a></span></span><span> </span><span id="local-6989586621681155999"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155999"><span class="hs-identifier hs-var">cmd_ty</span></a></span></span><span> </span><span id="local-6989586621681155998"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155998"><span class="hs-identifier hs-var">cmd</span></a></span></span><span>
</span><span id="line-711"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; DsM () -&gt; DsM ()
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155998"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DsM () -&gt; DsM ()) -&gt; DsM () -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPoly"><span class="hs-identifier hs-var">dsNoLevPoly</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155999"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span>
</span><span id="line-712"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;When desugaring the command:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155998"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-713"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; DsM (CoreExpr, DIdSet)) -&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#trimInput"><span class="hs-identifier hs-var">trimInput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsLCmd"><span class="hs-identifier hs-var">dsLCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681156002"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681156001"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681156000"><span class="hs-identifier hs-var">stk_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155999"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155998"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-714"></span><span>
</span><span id="line-715"></span><span class="hs-comment">-- Feed back the list of local variables actually used a command,</span><span>
</span><span id="line-716"></span><span class="hs-comment">-- for use as the input tuple of the generated arrow.</span><span>
</span><span id="line-717"></span><span>
</span><span id="line-718"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#trimInput"><span class="hs-identifier hs-type">trimInput</span></a></span><span>
</span><span id="line-719"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-720"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-721"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-722"></span><span>                </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- same local vars as a list, fed back to</span><span>
</span><span id="line-723"></span><span>                                </span><span class="hs-comment">-- the inner function to form the tuple of</span><span>
</span><span id="line-724"></span><span>                                </span><span class="hs-comment">-- inputs to the arrow.</span><span>
</span><span id="line-725"></span><span id="trimInput"><span class="annot"><span class="annottext">trimInput :: ([Id] -&gt; DsM (CoreExpr, DIdSet)) -&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#trimInput"><span class="hs-identifier hs-var hs-var">trimInput</span></a></span></span><span> </span><span id="local-6989586621681155995"><span class="annot"><span class="annottext">[Id] -&gt; DsM (CoreExpr, DIdSet)
</span><a href="#local-6989586621681155995"><span class="hs-identifier hs-var">build_arrow</span></a></span></span><span>
</span><span id="line-726"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((CoreExpr, DIdSet, [Id]) -&gt; DsM (CoreExpr, DIdSet, [Id]))
-&gt; DsM (CoreExpr, DIdSet, [Id])
forall a. (a -&gt; DsM a) -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#fixDs"><span class="hs-identifier hs-var">fixDs</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">DIdSet
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681155993"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155993"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-727"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681155992"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155992"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155991"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155991"><span class="hs-identifier hs-var">free_vars</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; DsM (CoreExpr, DIdSet)
</span><a href="#local-6989586621681155995"><span class="hs-identifier hs-var">build_arrow</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155993"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-728"></span><span>        </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet, [Id]) -&gt; DsM (CoreExpr, DIdSet, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155992"><span class="hs-identifier hs-var">core_cmd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155991"><span class="hs-identifier hs-var">free_vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155991"><span class="hs-identifier hs-var">free_vars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-729"></span><span>
</span><span id="line-730"></span><span class="hs-comment">-- Desugaring for both HsCmdLam and HsCmdLamCase.</span><span>
</span><span id="line-731"></span><span class="hs-comment">--</span><span>
</span><span id="line-732"></span><span class="hs-comment">-- D; ys |-a cmd : stk t'</span><span>
</span><span id="line-733"></span><span class="hs-comment">-- -----------------------------------------------</span><span>
</span><span id="line-734"></span><span class="hs-comment">-- D; xs |-a \ p1 ... pk -&gt; cmd : (t1,...(tk,stk)...) t'</span><span>
</span><span id="line-735"></span><span class="hs-comment">--</span><span>
</span><span id="line-736"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs), (p1, ... (pk,stk)...)) -&gt; ((ys),stk)) cmd</span><span>
</span><span id="line-737"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdLam"><span class="hs-identifier hs-type">dsCmdLam</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>            </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-738"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>               </span><span class="hs-comment">-- set of local vars available to this command</span><span>
</span><span id="line-739"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                </span><span class="hs-comment">-- type of the stack (right-nested tuple)</span><span>
</span><span id="line-740"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                </span><span class="hs-comment">-- return type of the command</span><span>
</span><span id="line-741"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- argument patterns to desugar</span><span>
</span><span id="line-742"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>        </span><span class="hs-comment">-- body to desugar</span><span>
</span><span id="line-743"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                </span><span class="hs-comment">-- list of vars in the input to this command</span><span>
</span><span id="line-744"></span><span>                                </span><span class="hs-comment">-- This is typically fed back,</span><span>
</span><span id="line-745"></span><span>                                </span><span class="hs-comment">-- so don't pull on it too early</span><span>
</span><span id="line-746"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>      </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-747"></span><span>                 </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-748"></span><span id="dsCmdLam"><span class="annot"><span class="annottext">dsCmdLam :: DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; [LPat (GhcPass 'Typechecked)]
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLam"><span class="hs-identifier hs-var hs-var">dsCmdLam</span></a></span></span><span> </span><span id="local-6989586621681155989"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155989"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155988"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155988"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155987"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155987"><span class="hs-identifier hs-var">stack_ty</span></a></span></span><span> </span><span id="local-6989586621681155986"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155986"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681155985"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155985"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span id="local-6989586621681155984"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155984"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681155983"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155983"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-749"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155982"><span class="annot"><span class="annottext">pat_vars :: VarSet
</span><a href="#local-6989586621681155982"><span class="hs-identifier hs-var hs-var">pat_vars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectPatsBinders"><span class="hs-identifier hs-var">collectPatsBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155985"><span class="hs-identifier hs-var">pats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-750"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155980"><span class="annot"><span class="annottext">local_vars' :: VarSet
</span><a href="#local-6989586621681155980"><span class="hs-identifier hs-var hs-var">local_vars'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155982"><span class="hs-identifier hs-var">pat_vars</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155988"><span class="hs-identifier hs-var">local_vars</span></a></span><span>
</span><span id="line-751"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681155979"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155979"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155978"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155978"><span class="hs-identifier hs-var">stack_ty'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Type -&gt; ([Type], Type)
</span><a href="GHC.HsToCore.Arrows.html#splitTypeAt"><span class="hs-identifier hs-var">splitTypeAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located (Pat (GhcPass 'Typechecked))] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat (GhcPass 'Typechecked))]
[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155985"><span class="hs-identifier hs-var">pats</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155987"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-752"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155976"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155976"><span class="hs-identifier hs-var">core_body</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155975"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155975"><span class="hs-identifier hs-var">free_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155974"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155974"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-753"></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155989"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155980"><span class="hs-identifier hs-var">local_vars'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155978"><span class="hs-identifier hs-var">stack_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155986"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155984"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-754"></span><span>    </span><span id="local-6989586621681155973"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155973"><span class="hs-identifier hs-var">param_ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; DsM Id) -&gt; [Type] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDsNoLP"><span class="hs-identifier hs-var">newSysLocalDsNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681155979"><span class="hs-identifier hs-var">pat_tys</span></a></span><span>
</span><span id="line-755"></span><span>    </span><span id="local-6989586621681155972"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155972"><span class="hs-identifier hs-var">stack_id'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155978"><span class="hs-identifier hs-var">stack_ty'</span></a></span><span>
</span><span id="line-756"></span><span>
</span><span id="line-757"></span><span>    </span><span class="hs-comment">-- the expression is built from the inside out, so the actions</span><span>
</span><span id="line-758"></span><span>    </span><span class="hs-comment">-- are presented in reverse order</span><span>
</span><span id="line-759"></span><span>
</span><span id="line-760"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- build a new environment, plus what's left of the stack</span><span>
</span><span id="line-761"></span><span>        </span><span id="local-6989586621681155971"><span class="annot"><span class="annottext">core_expr :: CoreExpr
</span><a href="#local-6989586621681155971"><span class="hs-identifier hs-var hs-var">core_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#buildEnvStack"><span class="hs-identifier hs-var">buildEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155974"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155972"><span class="hs-identifier hs-var">stack_id'</span></a></span><span>
</span><span id="line-762"></span><span>        </span><span id="local-6989586621681155970"><span class="annot"><span class="annottext">in_ty :: Type
</span><a href="#local-6989586621681155970"><span class="hs-identifier hs-var hs-var">in_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155983"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155987"><span class="hs-identifier hs-var">stack_ty</span></a></span><span>
</span><span id="line-763"></span><span>        </span><span id="local-6989586621681155969"><span class="annot"><span class="annottext">in_ty' :: Type
</span><a href="#local-6989586621681155969"><span class="hs-identifier hs-var hs-var">in_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#envStackType"><span class="hs-identifier hs-var">envStackType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155974"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155978"><span class="hs-identifier hs-var">stack_ty'</span></a></span><span>
</span><span id="line-764"></span><span>
</span><span id="line-765"></span><span>    </span><span id="local-6989586621681155968"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155968"><span class="hs-identifier hs-var">fail_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkFailExpr"><span class="hs-identifier hs-var">mkFailExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155969"><span class="hs-identifier hs-var">in_ty'</span></a></span><span>
</span><span id="line-766"></span><span>    </span><span class="hs-comment">-- match the patterns against the parameters</span><span>
</span><span id="line-767"></span><span>    </span><span id="local-6989586621681155966"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155966"><span class="hs-identifier hs-var">match_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
-&gt; HsMatchContext GhcRn
-&gt; [LPat (GhcPass 'Typechecked)]
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchSimplys"><span class="hs-identifier hs-var">matchSimplys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CoreExpr) -&gt; [Id] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155973"><span class="hs-identifier hs-var">param_ids</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155985"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155971"><span class="hs-identifier hs-var">core_expr</span></a></span><span>
</span><span id="line-768"></span><span>                    </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155968"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-769"></span><span>    </span><span class="hs-comment">-- match the parameters against the top of the old stack</span><span>
</span><span id="line-770"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155964"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155964"><span class="hs-identifier hs-var">stack_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155963"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155963"><span class="hs-identifier hs-var">param_code</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM (Id, CoreExpr)
</span><a href="GHC.HsToCore.Arrows.html#matchVarStack"><span class="hs-identifier hs-var">matchVarStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155973"><span class="hs-identifier hs-var">param_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155972"><span class="hs-identifier hs-var">stack_id'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155966"><span class="hs-identifier hs-var">match_code</span></a></span><span>
</span><span id="line-771"></span><span>    </span><span class="hs-comment">-- match the old environment and stack against the input</span><span>
</span><span id="line-772"></span><span>    </span><span id="local-6989586621681155962"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155962"><span class="hs-identifier hs-var">select_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155983"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155964"><span class="hs-identifier hs-var">stack_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155963"><span class="hs-identifier hs-var">param_code</span></a></span><span>
</span><span id="line-773"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155989"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155970"><span class="hs-identifier hs-var">in_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155969"><span class="hs-identifier hs-var">in_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155986"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155962"><span class="hs-identifier hs-var">select_code</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155976"><span class="hs-identifier hs-var">core_body</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-774"></span><span>            </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155975"><span class="hs-identifier hs-var">free_vars</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetMinusUniqSet"><span class="hs-operator hs-var">`uniqDSetMinusUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155982"><span class="hs-identifier hs-var">pat_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span class="hs-comment">{-
Translation of command judgements of the form

        D |-a do { ss } : t
-}</span><span>
</span><span id="line-781"></span><span>
</span><span id="line-782"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdDo"><span class="hs-identifier hs-type">dsCmdDo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-783"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this statement</span><span>
</span><span id="line-784"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                 </span><span class="hs-comment">-- return type of the statement</span><span>
</span><span id="line-785"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#CmdLStmt"><span class="hs-identifier hs-type">CmdLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- statements to desugar</span><span>
</span><span id="line-786"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- list of vars in the input to this statement</span><span>
</span><span id="line-787"></span><span>                                </span><span class="hs-comment">-- This is typically fed back,</span><span>
</span><span id="line-788"></span><span>                                </span><span class="hs-comment">-- so don't pull on it too early</span><span>
</span><span id="line-789"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-790"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-791"></span><span>
</span><span id="line-792"></span><span id="dsCmdDo"><span class="annot"><span class="annottext">dsCmdDo :: DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdDo"><span class="hs-identifier hs-var hs-var">dsCmdDo</span></a></span></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM (CoreExpr, DIdSet)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsCmdDo&quot;</span></span><span>
</span><span id="line-793"></span><span>
</span><span id="line-794"></span><span class="hs-comment">-- D; xs |-a c : () --&gt; t</span><span>
</span><span id="line-795"></span><span class="hs-comment">-- --------------------------</span><span>
</span><span id="line-796"></span><span class="hs-comment">-- D; xs |-a do { c } : t</span><span>
</span><span id="line-797"></span><span class="hs-comment">--</span><span>
</span><span id="line-798"></span><span class="hs-comment">--              ---&gt; premap (\ (xs) -&gt; ((xs), ())) c</span><span>
</span><span id="line-799"></span><span>
</span><span id="line-800"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdDo"><span class="hs-identifier hs-var">dsCmdDo</span></a></span><span> </span><span id="local-6989586621681155959"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155959"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155958"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155958"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155957"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155957"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681155956"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155956"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155954"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155954"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681155953"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155953"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-801"></span><span>    </span><span class="annot"><span class="annottext">SrcSpan -&gt; DsM () -&gt; DsM ()
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155956"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM () -&gt; DsM ()) -&gt; DsM () -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPoly"><span class="hs-identifier hs-var">dsNoLevPoly</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155957"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-802"></span><span>                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the command:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155954"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-803"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155952"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155952"><span class="hs-identifier hs-var">core_body</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155951"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155951"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsLCmd"><span class="hs-identifier hs-var">dsLCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155959"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155958"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155957"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155954"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155953"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-804"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155950"><span class="annot"><span class="annottext">env_ty :: Type
</span><a href="#local-6989586621681155950"><span class="hs-identifier hs-var hs-var">env_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155953"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-805"></span><span>    </span><span id="local-6989586621681155949"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155949"><span class="hs-identifier hs-var">env_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155950"><span class="hs-identifier hs-var">env_ty</span></a></span><span>
</span><span id="line-806"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155948"><span class="annot"><span class="annottext">core_map :: CoreExpr
</span><a href="#local-6989586621681155948"><span class="hs-identifier hs-var hs-var">core_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155949"><span class="hs-identifier hs-var">env_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155949"><span class="hs-identifier hs-var">env_var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCoreUnitExpr"><span class="hs-identifier hs-var">mkCoreUnitExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-807"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155959"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-808"></span><span>                        </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155950"><span class="hs-identifier hs-var">env_ty</span></a></span><span>
</span><span id="line-809"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155950"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span>                        </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155957"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-811"></span><span>                        </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155948"><span class="hs-identifier hs-var">core_map</span></a></span><span>
</span><span id="line-812"></span><span>                        </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155952"><span class="hs-identifier hs-var">core_body</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-813"></span><span>        </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155951"><span class="hs-identifier hs-var">env_ids'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-814"></span><span>
</span><span id="line-815"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdDo"><span class="hs-identifier hs-var">dsCmdDo</span></a></span><span> </span><span id="local-6989586621681155947"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155947"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155946"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155946"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155945"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155945"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155944"><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155944"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155943"><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155943"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155942"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155942"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-816"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155941"><span class="annot"><span class="annottext">bound_vars :: VarSet
</span><a href="#local-6989586621681155941"><span class="hs-identifier hs-var hs-var">bound_vars</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked) -&gt; [Id]
forall body. LStmt (GhcPass 'Typechecked) body -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectLStmtBinders"><span class="hs-identifier hs-var">collectLStmtBinders</span></a></span><span> </span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155944"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-817"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155939"><span class="annot"><span class="annottext">local_vars' :: VarSet
</span><a href="#local-6989586621681155939"><span class="hs-identifier hs-var hs-var">local_vars'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155941"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155946"><span class="hs-identifier hs-var">local_vars</span></a></span><span>
</span><span id="line-818"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155938"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155938"><span class="hs-identifier hs-var">core_stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155937"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155937"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; DsM (CoreExpr, DIdSet)) -&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#trimInput"><span class="hs-identifier hs-var">trimInput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdDo"><span class="hs-identifier hs-var">dsCmdDo</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155947"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155939"><span class="hs-identifier hs-var">local_vars'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155945"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155943"><span class="hs-identifier hs-var">stmts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-819"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155936"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155936"><span class="hs-identifier hs-var">core_stmt</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155935"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155935"><span class="hs-identifier hs-var">fv_stmt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; CmdLStmt (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLStmt"><span class="hs-identifier hs-var">dsCmdLStmt</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155947"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155946"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155937"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155944"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155942"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-820"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155947"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-821"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155942"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-822"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155937"><span class="hs-identifier hs-var">env_ids'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-823"></span><span>                </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155945"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-824"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155936"><span class="hs-identifier hs-var">core_stmt</span></a></span><span>
</span><span id="line-825"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155938"><span class="hs-identifier hs-var">core_stmts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-826"></span><span>              </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155935"><span class="hs-identifier hs-var">fv_stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span>
</span><span id="line-828"></span><span class="hs-comment">{-
A statement maps one local environment to another, and is represented
as an arrow from one tuple type to another.  A statement sequence is
translated to a composition of such arrows.
-}</span><span>
</span><span id="line-833"></span><span>
</span><span id="line-834"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdLStmt"><span class="hs-identifier hs-type">dsCmdLStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#CmdLStmt"><span class="hs-identifier hs-type">CmdLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-835"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-836"></span><span id="dsCmdLStmt"><span class="annot"><span class="annottext">dsCmdLStmt :: DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; CmdLStmt (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLStmt"><span class="hs-identifier hs-var hs-var">dsCmdLStmt</span></a></span></span><span> </span><span id="local-6989586621681155933"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155933"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155932"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155932"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155931"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155931"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span id="local-6989586621681155930"><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155930"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span id="local-6989586621681155929"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155929"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span>
</span><span id="line-837"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; StmtLR
     (GhcPass 'Typechecked)
     (GhcPass 'Typechecked)
     (LHsCmd (GhcPass 'Typechecked))
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-var">dsCmdStmt</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155933"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155932"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155931"><span class="hs-identifier hs-var">out_ids</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
-&gt; StmtLR
     (GhcPass 'Typechecked)
     (GhcPass 'Typechecked)
     (LHsCmd (GhcPass 'Typechecked))
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155930"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155929"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-838"></span><span>
</span><span id="line-839"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-type">dsCmdStmt</span></a></span><span>
</span><span id="line-840"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-841"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this statement</span><span>
</span><span id="line-842"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- list of vars in the output of this statement</span><span>
</span><span id="line-843"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#CmdStmt"><span class="hs-identifier hs-type">CmdStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>        </span><span class="hs-comment">-- statement to desugar</span><span>
</span><span id="line-844"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- list of vars in the input to this statement</span><span>
</span><span id="line-845"></span><span>                                </span><span class="hs-comment">-- This is typically fed back,</span><span>
</span><span id="line-846"></span><span>                                </span><span class="hs-comment">-- so don't pull on it too early</span><span>
</span><span id="line-847"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-848"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-849"></span><span>
</span><span id="line-850"></span><span class="hs-comment">-- D; xs1 |-a c : () --&gt; t</span><span>
</span><span id="line-851"></span><span class="hs-comment">-- D; xs' |-a do { ss } : t'</span><span>
</span><span id="line-852"></span><span class="hs-comment">-- ------------------------------</span><span>
</span><span id="line-853"></span><span class="hs-comment">-- D; xs  |-a do { c; ss } : t'</span><span>
</span><span id="line-854"></span><span class="hs-comment">--</span><span>
</span><span id="line-855"></span><span class="hs-comment">--              ---&gt; premap (\ ((xs)) -&gt; (((xs1),()),(xs')))</span><span>
</span><span id="line-856"></span><span class="hs-comment">--                      (first c &gt;&gt;&gt; arr snd) &gt;&gt;&gt; ss</span><span>
</span><span id="line-857"></span><span>
</span><span id="line-858"></span><span id="dsCmdStmt"><span class="annot"><span class="annottext">dsCmdStmt :: DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; StmtLR
     (GhcPass 'Typechecked)
     (GhcPass 'Typechecked)
     (LHsCmd (GhcPass 'Typechecked))
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-var hs-var">dsCmdStmt</span></a></span></span><span> </span><span id="local-6989586621681155926"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155926"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155925"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155925"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155924"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155924"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span id="local-6989586621681155922"><span class="annot"><span class="annottext">XBodyStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155922"><span class="hs-identifier hs-var">c_ty</span></a></span></span><span> </span><span id="local-6989586621681155921"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155921"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155920"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155920"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-859"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155919"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155919"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155918"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155918"><span class="hs-identifier hs-var">fv_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155917"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155917"><span class="hs-identifier hs-var">env_ids1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155926"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155925"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XBodyStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155922"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155921"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-860"></span><span>    </span><span id="local-6989586621681155916"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155916"><span class="hs-identifier hs-var">core_mux</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-var">matchEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155920"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-861"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span>
</span><span id="line-862"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155917"><span class="hs-identifier hs-var">env_ids1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCoreUnitExpr"><span class="hs-identifier hs-var">mkCoreUnitExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-863"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155924"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-864"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-865"></span><span>        </span><span id="local-6989586621681155915"><span class="annot"><span class="annottext">in_ty :: Type
</span><a href="#local-6989586621681155915"><span class="hs-identifier hs-var hs-var">in_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155920"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-866"></span><span>        </span><span id="local-6989586621681155914"><span class="annot"><span class="annottext">in_ty1 :: Type
</span><a href="#local-6989586621681155914"><span class="hs-identifier hs-var hs-var">in_ty1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155917"><span class="hs-identifier hs-var">env_ids1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span>
</span><span id="line-867"></span><span>        </span><span id="local-6989586621681155913"><span class="annot"><span class="annottext">out_ty :: Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var hs-var">out_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155924"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-868"></span><span>        </span><span id="local-6989586621681155912"><span class="annot"><span class="annottext">before_c_ty :: Type
</span><a href="#local-6989586621681155912"><span class="hs-identifier hs-var hs-var">before_c_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155914"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-869"></span><span>        </span><span id="local-6989586621681155911"><span class="annot"><span class="annottext">after_c_ty :: Type
</span><a href="#local-6989586621681155911"><span class="hs-identifier hs-var hs-var">after_c_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XBodyStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155922"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-870"></span><span>    </span><span class="annot"><span class="annottext">Type -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPoly"><span class="hs-identifier hs-var">dsNoLevPoly</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XBodyStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155922"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="hs-comment">-- I (Richard E, Dec '16) have no idea what to say here</span><span>
</span><span id="line-871"></span><span>    </span><span id="local-6989586621681155909"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155909"><span class="hs-identifier hs-var">snd_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkSndExpr"><span class="hs-identifier hs-var">mkSndExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XBodyStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155922"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-872"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155926"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155915"><span class="hs-identifier hs-var">in_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155912"><span class="hs-identifier hs-var">before_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155916"><span class="hs-identifier hs-var">core_mux</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-873"></span><span>                </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155926"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155912"><span class="hs-identifier hs-var">before_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155911"><span class="hs-identifier hs-var">after_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-874"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_first"><span class="hs-identifier hs-var">do_first</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155926"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155914"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XBodyStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155922"><span class="hs-identifier hs-var">c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155919"><span class="hs-identifier hs-var">core_cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-875"></span><span>                </span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var">do_arr</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155926"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155911"><span class="hs-identifier hs-var">after_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155913"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155909"><span class="hs-identifier hs-var">snd_fn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-876"></span><span>              </span><span class="annot"><span class="annottext">DIdSet -&gt; [Id] -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#extendDVarSetList"><span class="hs-identifier hs-var">extendDVarSetList</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155918"><span class="hs-identifier hs-var">fv_cmd</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155924"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-877"></span><span>
</span><span id="line-878"></span><span class="hs-comment">-- D; xs1 |-a c : () --&gt; t</span><span>
</span><span id="line-879"></span><span class="hs-comment">-- D; xs' |-a do { ss } : t'            xs2 = xs' - defs(p)</span><span>
</span><span id="line-880"></span><span class="hs-comment">-- -----------------------------------</span><span>
</span><span id="line-881"></span><span class="hs-comment">-- D; xs  |-a do { p &lt;- c; ss } : t'</span><span>
</span><span id="line-882"></span><span class="hs-comment">--</span><span>
</span><span id="line-883"></span><span class="hs-comment">--              ---&gt; premap (\ (xs) -&gt; (((xs1),()),(xs2)))</span><span>
</span><span id="line-884"></span><span class="hs-comment">--                      (first c &gt;&gt;&gt; arr (\ (p, (xs2)) -&gt; (xs'))) &gt;&gt;&gt; ss</span><span>
</span><span id="line-885"></span><span class="hs-comment">--</span><span>
</span><span id="line-886"></span><span class="hs-comment">-- It would be simpler and more consistent to do this using second,</span><span>
</span><span id="line-887"></span><span class="hs-comment">-- but that's likely to be defined in terms of first.</span><span>
</span><span id="line-888"></span><span>
</span><span id="line-889"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-var">dsCmdStmt</span></a></span><span> </span><span id="local-6989586621681155907"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155907"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155906"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155906"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155905"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155905"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155903"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155903"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681155902"><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155902"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155901"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155901"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-890"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155900"><span class="annot"><span class="annottext">pat_ty :: Type
</span><a href="#local-6989586621681155900"><span class="hs-identifier hs-var hs-var">pat_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; Type
</span><a href="GHC.Tc.Utils.Zonk.html#hsLPatType"><span class="hs-identifier hs-var">hsLPatType</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155903"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-891"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155899"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155899"><span class="hs-identifier hs-var">core_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155898"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155898"><span class="hs-identifier hs-var">fv_cmd</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155897"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155897"><span class="hs-identifier hs-var">env_ids1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; Type
-&gt; Type
-&gt; LHsCmd (GhcPass 'Typechecked)
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmd"><span class="hs-identifier hs-var">dsfixCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155907"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155906"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155900"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155902"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-892"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155896"><span class="annot"><span class="annottext">pat_vars :: VarSet
</span><a href="#local-6989586621681155896"><span class="hs-identifier hs-var hs-var">pat_vars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectPatBinders"><span class="hs-identifier hs-var">collectPatBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155903"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-893"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-894"></span><span>        </span><span id="local-6989586621681155895"><span class="annot"><span class="annottext">env_ids2 :: [Id]
</span><a href="#local-6989586621681155895"><span class="hs-identifier hs-var hs-var">env_ids2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; [Id]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155896"><span class="hs-identifier hs-var">pat_vars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155905"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-895"></span><span>        </span><span id="local-6989586621681155892"><span class="annot"><span class="annottext">env_ty2 :: Type
</span><a href="#local-6989586621681155892"><span class="hs-identifier hs-var hs-var">env_ty2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155895"><span class="hs-identifier hs-var">env_ids2</span></a></span><span>
</span><span id="line-896"></span><span>
</span><span id="line-897"></span><span>    </span><span class="hs-comment">-- multiplexing function</span><span>
</span><span id="line-898"></span><span>    </span><span class="hs-comment">--          \ (xs) -&gt; (((xs1),()),(xs2))</span><span>
</span><span id="line-899"></span><span>
</span><span id="line-900"></span><span>    </span><span id="local-6989586621681155891"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155891"><span class="hs-identifier hs-var">core_mux</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-var">matchEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155901"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-901"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span>
</span><span id="line-902"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155897"><span class="hs-identifier hs-var">env_ids1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCoreUnitExpr"><span class="hs-identifier hs-var">mkCoreUnitExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-903"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155895"><span class="hs-identifier hs-var">env_ids2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-904"></span><span>
</span><span id="line-905"></span><span>    </span><span class="hs-comment">-- projection function</span><span>
</span><span id="line-906"></span><span>    </span><span class="hs-comment">--          \ (p, (xs2)) -&gt; (zs)</span><span>
</span><span id="line-907"></span><span>
</span><span id="line-908"></span><span>    </span><span id="local-6989586621681155890"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155890"><span class="hs-identifier hs-var">env_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155892"><span class="hs-identifier hs-var">env_ty2</span></a></span><span>
</span><span id="line-909"></span><span>    </span><span id="local-6989586621681155889"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155889"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf DsGblEnv DsLclEnv UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-910"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-911"></span><span>       </span><span id="local-6989586621681155888"><span class="annot"><span class="annottext">after_c_ty :: Type
</span><a href="#local-6989586621681155888"><span class="hs-identifier hs-var hs-var">after_c_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155900"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155892"><span class="hs-identifier hs-var">env_ty2</span></a></span><span>
</span><span id="line-912"></span><span>       </span><span id="local-6989586621681155887"><span class="annot"><span class="annottext">out_ty :: Type
</span><a href="#local-6989586621681155887"><span class="hs-identifier hs-var hs-var">out_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155905"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-913"></span><span>       </span><span id="local-6989586621681155886"><span class="annot"><span class="annottext">body_expr :: CoreExpr
</span><a href="#local-6989586621681155886"><span class="hs-identifier hs-var hs-var">body_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; Id -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCaseTuple"><span class="hs-identifier hs-var">coreCaseTuple</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155889"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155890"><span class="hs-identifier hs-var">env_id</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155895"><span class="hs-identifier hs-var">env_ids2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155905"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-914"></span><span>
</span><span id="line-915"></span><span>    </span><span id="local-6989586621681155885"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155885"><span class="hs-identifier hs-var">fail_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkFailExpr"><span class="hs-identifier hs-var">mkFailExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ModuleName -&gt; HsStmtContext GhcRn
forall p. Maybe ModuleName -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#DoExpr"><span class="hs-identifier hs-var">DoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155887"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-916"></span><span>    </span><span id="local-6989586621681155882"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155882"><span class="hs-identifier hs-var">pat_id</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; LPat (GhcPass 'Typechecked) -&gt; DsM Id
</span><a href="GHC.HsToCore.Utils.html#selectSimpleMatchVarL"><span class="hs-identifier hs-var">selectSimpleMatchVarL</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155903"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-917"></span><span>    </span><span id="local-6989586621681155881"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155881"><span class="hs-identifier hs-var">match_code</span></a></span></span><span>
</span><span id="line-918"></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat (GhcPass 'Typechecked)
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-var">matchSimply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155882"><span class="hs-identifier hs-var">pat_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ModuleName -&gt; HsStmtContext GhcRn
forall p. Maybe ModuleName -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#DoExpr"><span class="hs-identifier hs-var">DoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155903"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155886"><span class="hs-identifier hs-var">body_expr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155885"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-919"></span><span>    </span><span id="local-6989586621681155880"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155880"><span class="hs-identifier hs-var">pair_id</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155888"><span class="hs-identifier hs-var">after_c_ty</span></a></span><span>
</span><span id="line-920"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-921"></span><span>        </span><span id="local-6989586621681155879"><span class="annot"><span class="annottext">proj_expr :: CoreExpr
</span><a href="#local-6989586621681155879"><span class="hs-identifier hs-var hs-var">proj_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155880"><span class="hs-identifier hs-var">pair_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCasePair"><span class="hs-identifier hs-var">coreCasePair</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155880"><span class="hs-identifier hs-var">pair_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155882"><span class="hs-identifier hs-var">pat_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155890"><span class="hs-identifier hs-var">env_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155881"><span class="hs-identifier hs-var">match_code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-922"></span><span>
</span><span id="line-923"></span><span>    </span><span class="hs-comment">-- put it all together</span><span>
</span><span id="line-924"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-925"></span><span>        </span><span id="local-6989586621681155878"><span class="annot"><span class="annottext">in_ty :: Type
</span><a href="#local-6989586621681155878"><span class="hs-identifier hs-var hs-var">in_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155901"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-926"></span><span>        </span><span id="local-6989586621681155877"><span class="annot"><span class="annottext">in_ty1 :: Type
</span><a href="#local-6989586621681155877"><span class="hs-identifier hs-var hs-var">in_ty1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155897"><span class="hs-identifier hs-var">env_ids1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span>
</span><span id="line-927"></span><span>        </span><span id="local-6989586621681155876"><span class="annot"><span class="annottext">in_ty2 :: Type
</span><a href="#local-6989586621681155876"><span class="hs-identifier hs-var hs-var">in_ty2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155895"><span class="hs-identifier hs-var">env_ids2</span></a></span><span>
</span><span id="line-928"></span><span>        </span><span id="local-6989586621681155875"><span class="annot"><span class="annottext">before_c_ty :: Type
</span><a href="#local-6989586621681155875"><span class="hs-identifier hs-var hs-var">before_c_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155877"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155876"><span class="hs-identifier hs-var">in_ty2</span></a></span><span>
</span><span id="line-929"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155907"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155878"><span class="hs-identifier hs-var">in_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155875"><span class="hs-identifier hs-var">before_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155887"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155891"><span class="hs-identifier hs-var">core_mux</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-930"></span><span>                </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155907"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155875"><span class="hs-identifier hs-var">before_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155888"><span class="hs-identifier hs-var">after_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155887"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-931"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_first"><span class="hs-identifier hs-var">do_first</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155907"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155877"><span class="hs-identifier hs-var">in_ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155900"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155876"><span class="hs-identifier hs-var">in_ty2</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155899"><span class="hs-identifier hs-var">core_cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-932"></span><span>                </span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var">do_arr</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155907"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155888"><span class="hs-identifier hs-var">after_c_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155887"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155879"><span class="hs-identifier hs-var">proj_expr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-933"></span><span>              </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155898"><span class="hs-identifier hs-var">fv_cmd</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSet"><span class="hs-operator hs-var">`unionDVarSet`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#mkDVarSet"><span class="hs-identifier hs-var">mkDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155905"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-934"></span><span>                                     </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetMinusUniqSet"><span class="hs-operator hs-var">`uniqDSetMinusUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155896"><span class="hs-identifier hs-var">pat_vars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-935"></span><span>
</span><span id="line-936"></span><span class="hs-comment">-- D; xs' |-a do { ss } : t</span><span>
</span><span id="line-937"></span><span class="hs-comment">-- --------------------------------------</span><span>
</span><span id="line-938"></span><span class="hs-comment">-- D; xs  |-a do { let binds; ss } : t</span><span>
</span><span id="line-939"></span><span class="hs-comment">--</span><span>
</span><span id="line-940"></span><span class="hs-comment">--              ---&gt; arr (\ (xs) -&gt; let binds in (xs')) &gt;&gt;&gt; ss</span><span>
</span><span id="line-941"></span><span>
</span><span id="line-942"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-var">dsCmdStmt</span></a></span><span> </span><span id="local-6989586621681155873"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155873"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155872"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155872"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155871"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155871"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-type">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155869"><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155869"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155868"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155868"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-943"></span><span>    </span><span class="hs-comment">-- build a new environment using the let bindings</span><span>
</span><span id="line-944"></span><span>    </span><span id="local-6989586621681155867"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155867"><span class="hs-identifier hs-var">core_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked) -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLocalBinds"><span class="hs-identifier hs-var">dsLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155869"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155871"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-945"></span><span>    </span><span class="hs-comment">-- match the old environment against the input</span><span>
</span><span id="line-946"></span><span>    </span><span id="local-6989586621681155866"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155866"><span class="hs-identifier hs-var">core_map</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-var">matchEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155868"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155867"><span class="hs-identifier hs-var">core_binds</span></a></span><span>
</span><span id="line-947"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var">do_arr</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155873"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-948"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155868"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-949"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155871"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-950"></span><span>                        </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155866"><span class="hs-identifier hs-var">core_map</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-951"></span><span>            </span><span class="annot"><span class="annottext">CoreExpr -&gt; DIdSet
</span><a href="GHC.Core.FVs.html#exprFreeIdsDSet"><span class="hs-identifier hs-var">exprFreeIdsDSet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155867"><span class="hs-identifier hs-var">core_binds</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetIntersectUniqSet"><span class="hs-operator hs-var">`uniqDSetIntersectUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155872"><span class="hs-identifier hs-var">local_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-952"></span><span>
</span><span id="line-953"></span><span class="hs-comment">-- D; ys  |-a do { ss; returnA -&lt; ((xs1), (ys2)) } : ...</span><span>
</span><span id="line-954"></span><span class="hs-comment">-- D; xs' |-a do { ss' } : t</span><span>
</span><span id="line-955"></span><span class="hs-comment">-- ------------------------------------</span><span>
</span><span id="line-956"></span><span class="hs-comment">-- D; xs  |-a do { rec ss; ss' } : t</span><span>
</span><span id="line-957"></span><span class="hs-comment">--</span><span>
</span><span id="line-958"></span><span class="hs-comment">--                      xs1 = xs' /\ defs(ss)</span><span>
</span><span id="line-959"></span><span class="hs-comment">--                      xs2 = xs' - defs(ss)</span><span>
</span><span id="line-960"></span><span class="hs-comment">--                      ys1 = ys - defs(ss)</span><span>
</span><span id="line-961"></span><span class="hs-comment">--                      ys2 = ys /\ defs(ss)</span><span>
</span><span id="line-962"></span><span class="hs-comment">--</span><span>
</span><span id="line-963"></span><span class="hs-comment">--              ---&gt; arr (\(xs) -&gt; ((ys1),(xs2))) &gt;&gt;&gt;</span><span>
</span><span id="line-964"></span><span class="hs-comment">--                      first (loop (arr (\((ys1),~(ys2)) -&gt; (ys)) &gt;&gt;&gt; ss)) &gt;&gt;&gt;</span><span>
</span><span id="line-965"></span><span class="hs-comment">--                      arr (\((xs1),(xs2)) -&gt; (xs')) &gt;&gt;&gt; ss'</span><span>
</span><span id="line-966"></span><span>
</span><span id="line-967"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-var">dsCmdStmt</span></a></span><span> </span><span id="local-6989586621681155865"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155865"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155864"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155864"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155863"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155863"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span>
</span><span id="line-968"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [LStmtLR idL idR body]
</span><a href="GHC.Hs.Expr.html#recS_stmts"><span class="hs-identifier hs-var">recS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155860"><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155860"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-969"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_later_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_later_ids"><span class="hs-identifier hs-var">recS_later_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155858"><span class="annot"><span class="annottext">[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155858"><span class="hs-identifier hs-var">later_ids</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_rec_ids"><span class="hs-identifier hs-var">recS_rec_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155856"><span class="annot"><span class="annottext">[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155856"><span class="hs-identifier hs-var">rec_ids</span></a></span></span><span>
</span><span id="line-970"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ext :: forall idL idR body. StmtLR idL idR body -&gt; XRecStmt idL idR body
</span><a href="GHC.Hs.Expr.html#recS_ext"><span class="hs-identifier hs-var">recS_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmtTc"><span class="hs-identifier hs-type">RecStmtTc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_later_rets :: RecStmtTc -&gt; [HsExpr (GhcPass 'Typechecked)]
</span><a href="GHC.Hs.Expr.html#recS_later_rets"><span class="hs-identifier hs-var">recS_later_rets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155852"><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155852"><span class="hs-identifier hs-var">later_rets</span></a></span></span><span>
</span><span id="line-971"></span><span>                                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_rets :: RecStmtTc -&gt; [HsExpr (GhcPass 'Typechecked)]
</span><a href="GHC.Hs.Expr.html#recS_rec_rets"><span class="hs-identifier hs-var">recS_rec_rets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155850"><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155850"><span class="hs-identifier hs-var">rec_rets</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-972"></span><span>        </span><span id="local-6989586621681155849"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155849"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-973"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-974"></span><span>        </span><span id="local-6989586621681155848"><span class="annot"><span class="annottext">later_ids_set :: VarSet
</span><a href="#local-6989586621681155848"><span class="hs-identifier hs-var hs-var">later_ids_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155858"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-975"></span><span>        </span><span id="local-6989586621681155847"><span class="annot"><span class="annottext">env2_ids :: [Id]
</span><a href="#local-6989586621681155847"><span class="hs-identifier hs-var hs-var">env2_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; [Id]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155848"><span class="hs-identifier hs-var">later_ids_set</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155863"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-976"></span><span>        </span><span id="local-6989586621681155846"><span class="annot"><span class="annottext">env2_id_set :: DIdSet
</span><a href="#local-6989586621681155846"><span class="hs-identifier hs-var hs-var">env2_id_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#mkDVarSet"><span class="hs-identifier hs-var">mkDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155847"><span class="hs-identifier hs-var">env2_ids</span></a></span><span>
</span><span id="line-977"></span><span>        </span><span id="local-6989586621681155845"><span class="annot"><span class="annottext">env2_ty :: Type
</span><a href="#local-6989586621681155845"><span class="hs-identifier hs-var hs-var">env2_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155847"><span class="hs-identifier hs-var">env2_ids</span></a></span><span>
</span><span id="line-978"></span><span>
</span><span id="line-979"></span><span>    </span><span class="hs-comment">-- post_loop_fn = \((later_ids),(env2_ids)) -&gt; (out_ids)</span><span>
</span><span id="line-980"></span><span>
</span><span id="line-981"></span><span>    </span><span id="local-6989586621681155844"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155844"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf DsGblEnv DsLclEnv UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-982"></span><span>    </span><span id="local-6989586621681155843"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155843"><span class="hs-identifier hs-var">env2_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155845"><span class="hs-identifier hs-var">env2_ty</span></a></span><span>
</span><span id="line-983"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-984"></span><span>        </span><span id="local-6989586621681155842"><span class="annot"><span class="annottext">later_ty :: Type
</span><a href="#local-6989586621681155842"><span class="hs-identifier hs-var hs-var">later_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155858"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-985"></span><span>        </span><span id="local-6989586621681155841"><span class="annot"><span class="annottext">post_pair_ty :: Type
</span><a href="#local-6989586621681155841"><span class="hs-identifier hs-var hs-var">post_pair_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155842"><span class="hs-identifier hs-var">later_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155845"><span class="hs-identifier hs-var">env2_ty</span></a></span><span>
</span><span id="line-986"></span><span>        </span><span id="local-6989586621681155840"><span class="annot"><span class="annottext">post_loop_body :: CoreExpr
</span><a href="#local-6989586621681155840"><span class="hs-identifier hs-var hs-var">post_loop_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; Id -&gt; [Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#coreCaseTuple"><span class="hs-identifier hs-var">coreCaseTuple</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681155844"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155843"><span class="hs-identifier hs-var">env2_id</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155847"><span class="hs-identifier hs-var">env2_ids</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155863"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-987"></span><span>
</span><span id="line-988"></span><span>    </span><span id="local-6989586621681155839"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155839"><span class="hs-identifier hs-var">post_loop_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155858"><span class="hs-identifier hs-var">later_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155843"><span class="hs-identifier hs-var">env2_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155840"><span class="hs-identifier hs-var">post_loop_body</span></a></span><span>
</span><span id="line-989"></span><span>
</span><span id="line-990"></span><span>    </span><span class="hs-comment">--- loop (...)</span><span>
</span><span id="line-991"></span><span>
</span><span id="line-992"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155838"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155838"><span class="hs-identifier hs-var">core_loop</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155837"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155837"><span class="hs-identifier hs-var">env1_id_set</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155836"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155836"><span class="hs-identifier hs-var">env1_ids</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-993"></span><span>               </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; [HsExpr (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; [HsExpr (GhcPass 'Typechecked)]
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsRecCmd"><span class="hs-identifier hs-var">dsRecCmd</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155865"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155864"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155860"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155858"><span class="hs-identifier hs-var">later_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155852"><span class="hs-identifier hs-var">later_rets</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155856"><span class="hs-identifier hs-var">rec_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155850"><span class="hs-identifier hs-var">rec_rets</span></a></span><span>
</span><span id="line-994"></span><span>
</span><span id="line-995"></span><span>    </span><span class="hs-comment">-- pre_loop_fn = \(env_ids) -&gt; ((env1_ids),(env2_ids))</span><span>
</span><span id="line-996"></span><span>
</span><span id="line-997"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-998"></span><span>        </span><span id="local-6989586621681155834"><span class="annot"><span class="annottext">env1_ty :: Type
</span><a href="#local-6989586621681155834"><span class="hs-identifier hs-var hs-var">env1_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155836"><span class="hs-identifier hs-var">env1_ids</span></a></span><span>
</span><span id="line-999"></span><span>        </span><span id="local-6989586621681155833"><span class="annot"><span class="annottext">pre_pair_ty :: Type
</span><a href="#local-6989586621681155833"><span class="hs-identifier hs-var hs-var">pre_pair_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155834"><span class="hs-identifier hs-var">env1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155845"><span class="hs-identifier hs-var">env2_ty</span></a></span><span>
</span><span id="line-1000"></span><span>        </span><span id="local-6989586621681155832"><span class="annot"><span class="annottext">pre_loop_body :: CoreExpr
</span><a href="#local-6989586621681155832"><span class="hs-identifier hs-var hs-var">pre_loop_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155836"><span class="hs-identifier hs-var">env1_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1001"></span><span>                                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155847"><span class="hs-identifier hs-var">env2_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1002"></span><span>
</span><span id="line-1003"></span><span>    </span><span id="local-6989586621681155831"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155831"><span class="hs-identifier hs-var">pre_loop_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-var">matchEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155849"><span class="hs-identifier hs-var">env_ids</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155832"><span class="hs-identifier hs-var">pre_loop_body</span></a></span><span>
</span><span id="line-1004"></span><span>
</span><span id="line-1005"></span><span>    </span><span class="hs-comment">-- arr pre_loop_fn &gt;&gt;&gt; first (loop (...)) &gt;&gt;&gt; arr post_loop_fn</span><span>
</span><span id="line-1006"></span><span>
</span><span id="line-1007"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-1008"></span><span>        </span><span id="local-6989586621681155830"><span class="annot"><span class="annottext">env_ty :: Type
</span><a href="#local-6989586621681155830"><span class="hs-identifier hs-var hs-var">env_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155849"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-1009"></span><span>        </span><span id="local-6989586621681155829"><span class="annot"><span class="annottext">out_ty :: Type
</span><a href="#local-6989586621681155829"><span class="hs-identifier hs-var hs-var">out_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155863"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-1010"></span><span>        </span><span id="local-6989586621681155828"><span class="annot"><span class="annottext">core_body :: CoreExpr
</span><a href="#local-6989586621681155828"><span class="hs-identifier hs-var hs-var">core_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155865"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155830"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155833"><span class="hs-identifier hs-var">pre_pair_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155829"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-1011"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155831"><span class="hs-identifier hs-var">pre_loop_fn</span></a></span><span>
</span><span id="line-1012"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155865"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155833"><span class="hs-identifier hs-var">pre_pair_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155841"><span class="hs-identifier hs-var">post_pair_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155829"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-1013"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_first"><span class="hs-identifier hs-var">do_first</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155865"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155834"><span class="hs-identifier hs-var">env1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155842"><span class="hs-identifier hs-var">later_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155845"><span class="hs-identifier hs-var">env2_ty</span></a></span><span>
</span><span id="line-1014"></span><span>                                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155838"><span class="hs-identifier hs-var">core_loop</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1015"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var">do_arr</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155865"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155841"><span class="hs-identifier hs-var">post_pair_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155829"><span class="hs-identifier hs-var">out_ty</span></a></span><span>
</span><span id="line-1016"></span><span>                                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155839"><span class="hs-identifier hs-var">post_loop_fn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1017"></span><span>
</span><span id="line-1018"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155828"><span class="hs-identifier hs-var">core_body</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155837"><span class="hs-identifier hs-var">env1_id_set</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSet"><span class="hs-operator hs-var">`unionDVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155846"><span class="hs-identifier hs-var">env2_id_set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1019"></span><span>
</span><span id="line-1020"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmt"><span class="hs-identifier hs-var">dsCmdStmt</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">StmtLR
  (GhcPass 'Typechecked)
  (GhcPass 'Typechecked)
  (LHsCmd (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155827"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155827"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DsM (CoreExpr, DIdSet)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsCmdStmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155827"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1021"></span><span>
</span><span id="line-1022"></span><span class="hs-comment">--      loop (premap (\ ((env1_ids), ~(rec_ids)) -&gt; (env_ids))</span><span>
</span><span id="line-1023"></span><span class="hs-comment">--            (ss &gt;&gt;&gt; arr (\ (out_ids) -&gt; ((later_rets),(rec_rets))))) &gt;&gt;&gt;</span><span>
</span><span id="line-1024"></span><span>
</span><span id="line-1025"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsRecCmd"><span class="hs-identifier hs-type">dsRecCmd</span></a></span><span>
</span><span id="line-1026"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-1027"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this statement</span><span>
</span><span id="line-1028"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#CmdLStmt"><span class="hs-identifier hs-type">CmdLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- list of statements inside the RecCmd</span><span>
</span><span id="line-1029"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- list of vars defined here and used later</span><span>
</span><span id="line-1030"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>       </span><span class="hs-comment">-- expressions corresponding to later_ids</span><span>
</span><span id="line-1031"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- list of vars fed back through the loop</span><span>
</span><span id="line-1032"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>       </span><span class="hs-comment">-- expressions corresponding to rec_ids</span><span>
</span><span id="line-1033"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared statement</span><span>
</span><span id="line-1034"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-1035"></span><span>                </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- same local vars as a list</span><span>
</span><span id="line-1036"></span><span>
</span><span id="line-1037"></span><span id="dsRecCmd"><span class="annot"><span class="annottext">dsRecCmd :: DsCmdEnv
-&gt; VarSet
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; [HsExpr (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; [HsExpr (GhcPass 'Typechecked)]
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsRecCmd"><span class="hs-identifier hs-var hs-var">dsRecCmd</span></a></span></span><span> </span><span id="local-6989586621681155826"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155826"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155825"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155825"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155824"><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155824"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681155823"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155823"><span class="hs-identifier hs-var">later_ids</span></a></span></span><span> </span><span id="local-6989586621681155822"><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155822"><span class="hs-identifier hs-var">later_rets</span></a></span></span><span> </span><span id="local-6989586621681155821"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155821"><span class="hs-identifier hs-var">rec_ids</span></a></span></span><span> </span><span id="local-6989586621681155820"><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155820"><span class="hs-identifier hs-var">rec_rets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1038"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-1039"></span><span>        </span><span id="local-6989586621681155819"><span class="annot"><span class="annottext">later_id_set :: VarSet
</span><a href="#local-6989586621681155819"><span class="hs-identifier hs-var hs-var">later_id_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155823"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-1040"></span><span>        </span><span id="local-6989586621681155818"><span class="annot"><span class="annottext">rec_id_set :: VarSet
</span><a href="#local-6989586621681155818"><span class="hs-identifier hs-var hs-var">rec_id_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155821"><span class="hs-identifier hs-var">rec_ids</span></a></span><span>
</span><span id="line-1041"></span><span>        </span><span id="local-6989586621681155817"><span class="annot"><span class="annottext">local_vars' :: VarSet
</span><a href="#local-6989586621681155817"><span class="hs-identifier hs-var hs-var">local_vars'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155818"><span class="hs-identifier hs-var">rec_id_set</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155819"><span class="hs-identifier hs-var">later_id_set</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155825"><span class="hs-identifier hs-var">local_vars</span></a></span><span>
</span><span id="line-1042"></span><span>
</span><span id="line-1043"></span><span>    </span><span class="hs-comment">-- mk_pair_fn = \ (out_ids) -&gt; ((later_rets),(rec_rets))</span><span>
</span><span id="line-1044"></span><span>
</span><span id="line-1045"></span><span>    </span><span id="local-6989586621681155816"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155816"><span class="hs-identifier hs-var">core_later_rets</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr)
-&gt; [HsExpr (GhcPass 'Typechecked)]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155822"><span class="hs-identifier hs-var">later_rets</span></a></span><span>
</span><span id="line-1046"></span><span>    </span><span id="local-6989586621681155815"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155815"><span class="hs-identifier hs-var">core_rec_rets</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr)
-&gt; [HsExpr (GhcPass 'Typechecked)]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Typechecked) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[HsExpr (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155820"><span class="hs-identifier hs-var">rec_rets</span></a></span><span>
</span><span id="line-1047"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-1048"></span><span>        </span><span class="hs-comment">-- possibly polymorphic version of vars of later_ids and rec_ids</span><span>
</span><span id="line-1049"></span><span>        </span><span id="local-6989586621681155814"><span class="annot"><span class="annottext">out_ids :: [Id]
</span><a href="#local-6989586621681155814"><span class="hs-identifier hs-var hs-var">out_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [Id]
</span><a href="GHC.Core.FVs.html#exprsFreeIdsList"><span class="hs-identifier hs-var">exprsFreeIdsList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155816"><span class="hs-identifier hs-var">core_later_rets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155815"><span class="hs-identifier hs-var">core_rec_rets</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1050"></span><span>        </span><span id="local-6989586621681155812"><span class="annot"><span class="annottext">out_ty :: Type
</span><a href="#local-6989586621681155812"><span class="hs-identifier hs-var hs-var">out_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155814"><span class="hs-identifier hs-var">out_ids</span></a></span><span>
</span><span id="line-1051"></span><span>
</span><span id="line-1052"></span><span>        </span><span id="local-6989586621681155811"><span class="annot"><span class="annottext">later_tuple :: CoreExpr
</span><a href="#local-6989586621681155811"><span class="hs-identifier hs-var hs-var">later_tuple</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155816"><span class="hs-identifier hs-var">core_later_rets</span></a></span><span>
</span><span id="line-1053"></span><span>        </span><span id="local-6989586621681155809"><span class="annot"><span class="annottext">later_ty :: Type
</span><a href="#local-6989586621681155809"><span class="hs-identifier hs-var hs-var">later_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155823"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-1054"></span><span>
</span><span id="line-1055"></span><span>        </span><span id="local-6989586621681155808"><span class="annot"><span class="annottext">rec_tuple :: CoreExpr
</span><a href="#local-6989586621681155808"><span class="hs-identifier hs-var hs-var">rec_tuple</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155815"><span class="hs-identifier hs-var">core_rec_rets</span></a></span><span>
</span><span id="line-1056"></span><span>        </span><span id="local-6989586621681155807"><span class="annot"><span class="annottext">rec_ty :: Type
</span><a href="#local-6989586621681155807"><span class="hs-identifier hs-var hs-var">rec_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155821"><span class="hs-identifier hs-var">rec_ids</span></a></span><span>
</span><span id="line-1057"></span><span>
</span><span id="line-1058"></span><span>        </span><span id="local-6989586621681155806"><span class="annot"><span class="annottext">out_pair :: CoreExpr
</span><a href="#local-6989586621681155806"><span class="hs-identifier hs-var hs-var">out_pair</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairExpr"><span class="hs-identifier hs-var">mkCorePairExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155811"><span class="hs-identifier hs-var">later_tuple</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155808"><span class="hs-identifier hs-var">rec_tuple</span></a></span><span>
</span><span id="line-1059"></span><span>        </span><span id="local-6989586621681155805"><span class="annot"><span class="annottext">out_pair_ty :: Type
</span><a href="#local-6989586621681155805"><span class="hs-identifier hs-var hs-var">out_pair_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155809"><span class="hs-identifier hs-var">later_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155807"><span class="hs-identifier hs-var">rec_ty</span></a></span><span>
</span><span id="line-1060"></span><span>
</span><span id="line-1061"></span><span>    </span><span id="local-6989586621681155804"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155804"><span class="hs-identifier hs-var">mk_pair_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnv"><span class="hs-identifier hs-var">matchEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155814"><span class="hs-identifier hs-var">out_ids</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155806"><span class="hs-identifier hs-var">out_pair</span></a></span><span>
</span><span id="line-1062"></span><span>
</span><span id="line-1063"></span><span>    </span><span class="hs-comment">-- ss</span><span>
</span><span id="line-1064"></span><span>
</span><span id="line-1065"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155803"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155803"><span class="hs-identifier hs-var">core_stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155802"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155802"><span class="hs-identifier hs-var">fv_stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155801"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155801"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmdStmts"><span class="hs-identifier hs-var">dsfixCmdStmts</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155826"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155817"><span class="hs-identifier hs-var">local_vars'</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155814"><span class="hs-identifier hs-var">out_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155824"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-1066"></span><span>
</span><span id="line-1067"></span><span>    </span><span class="hs-comment">-- squash_pair_fn = \ ((env1_ids), ~(rec_ids)) -&gt; (env_ids)</span><span>
</span><span id="line-1068"></span><span>
</span><span id="line-1069"></span><span>    </span><span id="local-6989586621681155799"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155799"><span class="hs-identifier hs-var">rec_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155807"><span class="hs-identifier hs-var">rec_ty</span></a></span><span>
</span><span id="line-1070"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-1071"></span><span>        </span><span id="local-6989586621681155798"><span class="annot"><span class="annottext">env1_id_set :: DIdSet
</span><a href="#local-6989586621681155798"><span class="hs-identifier hs-var hs-var">env1_id_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155802"><span class="hs-identifier hs-var">fv_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; VarSet -&gt; DIdSet
forall a. UniqDSet a -&gt; UniqSet a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetMinusUniqSet"><span class="hs-operator hs-var">`uniqDSetMinusUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155818"><span class="hs-identifier hs-var">rec_id_set</span></a></span><span>
</span><span id="line-1072"></span><span>        </span><span id="local-6989586621681155797"><span class="annot"><span class="annottext">env1_ids :: [Id]
</span><a href="#local-6989586621681155797"><span class="hs-identifier hs-var hs-var">env1_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155798"><span class="hs-identifier hs-var">env1_id_set</span></a></span><span>
</span><span id="line-1073"></span><span>        </span><span id="local-6989586621681155796"><span class="annot"><span class="annottext">env1_ty :: Type
</span><a href="#local-6989586621681155796"><span class="hs-identifier hs-var hs-var">env1_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155797"><span class="hs-identifier hs-var">env1_ids</span></a></span><span>
</span><span id="line-1074"></span><span>        </span><span id="local-6989586621681155795"><span class="annot"><span class="annottext">in_pair_ty :: Type
</span><a href="#local-6989586621681155795"><span class="hs-identifier hs-var hs-var">in_pair_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Type
</span><a href="GHC.HsToCore.Arrows.html#mkCorePairTy"><span class="hs-identifier hs-var">mkCorePairTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155796"><span class="hs-identifier hs-var">env1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155807"><span class="hs-identifier hs-var">rec_ty</span></a></span><span>
</span><span id="line-1075"></span><span>        </span><span id="local-6989586621681155794"><span class="annot"><span class="annottext">core_body :: CoreExpr
</span><a href="#local-6989586621681155794"><span class="hs-identifier hs-var hs-var">core_body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreTup"><span class="hs-identifier hs-var">mkBigCoreTup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CoreExpr) -&gt; [Id] -&gt; [CoreExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
</span><a href="#local-6989586621681155793"><span class="hs-identifier hs-var">selectVar</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155801"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1076"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-1077"></span><span>            </span><span id="local-6989586621681155793"><span class="annot"><span class="annottext">selectVar :: Id -&gt; CoreExpr
</span><a href="#local-6989586621681155793"><span class="hs-identifier hs-var hs-var">selectVar</span></a></span></span><span> </span><span id="local-6989586621681155792"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155792"><span class="hs-identifier hs-var">v</span></a></span></span><span>
</span><span id="line-1078"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155792"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155818"><span class="hs-identifier hs-var">rec_id_set</span></a></span><span>
</span><span id="line-1079"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier hs-var">mkTupleSelector</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155821"><span class="hs-identifier hs-var">rec_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155792"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155799"><span class="hs-identifier hs-var">rec_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155799"><span class="hs-identifier hs-var">rec_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1080"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155792"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-1081"></span><span>
</span><span id="line-1082"></span><span>    </span><span id="local-6989586621681155790"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155790"><span class="hs-identifier hs-var">squash_pair_fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Id -&gt; CoreExpr -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchEnvStack"><span class="hs-identifier hs-var">matchEnvStack</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155797"><span class="hs-identifier hs-var">env1_ids</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155799"><span class="hs-identifier hs-var">rec_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155794"><span class="hs-identifier hs-var">core_body</span></a></span><span>
</span><span id="line-1083"></span><span>
</span><span id="line-1084"></span><span>    </span><span class="hs-comment">-- loop (premap squash_pair_fn (ss &gt;&gt;&gt; arr mk_pair_fn))</span><span>
</span><span id="line-1085"></span><span>
</span><span id="line-1086"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-1087"></span><span>        </span><span id="local-6989586621681155789"><span class="annot"><span class="annottext">env_ty :: Type
</span><a href="#local-6989586621681155789"><span class="hs-identifier hs-var hs-var">env_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155801"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-1088"></span><span>        </span><span id="local-6989586621681155788"><span class="annot"><span class="annottext">core_loop :: CoreExpr
</span><a href="#local-6989586621681155788"><span class="hs-identifier hs-var hs-var">core_loop</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_loop"><span class="hs-identifier hs-var">do_loop</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155826"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155796"><span class="hs-identifier hs-var">env1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155809"><span class="hs-identifier hs-var">later_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155807"><span class="hs-identifier hs-var">rec_ty</span></a></span><span>
</span><span id="line-1089"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_premap"><span class="hs-identifier hs-var">do_premap</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155826"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155795"><span class="hs-identifier hs-var">in_pair_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155789"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155805"><span class="hs-identifier hs-var">out_pair_ty</span></a></span><span>
</span><span id="line-1090"></span><span>                        </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155790"><span class="hs-identifier hs-var">squash_pair_fn</span></a></span><span>
</span><span id="line-1091"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155826"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155789"><span class="hs-identifier hs-var">env_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155812"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155805"><span class="hs-identifier hs-var">out_pair_ty</span></a></span><span>
</span><span id="line-1092"></span><span>                                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155803"><span class="hs-identifier hs-var">core_stmts</span></a></span><span>
</span><span id="line-1093"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_arr"><span class="hs-identifier hs-var">do_arr</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155826"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155812"><span class="hs-identifier hs-var">out_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155805"><span class="hs-identifier hs-var">out_pair_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155804"><span class="hs-identifier hs-var">mk_pair_fn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1094"></span><span>
</span><span id="line-1095"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet, [Id]) -&gt; DsM (CoreExpr, DIdSet, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155788"><span class="hs-identifier hs-var">core_loop</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155798"><span class="hs-identifier hs-var">env1_id_set</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155797"><span class="hs-identifier hs-var">env1_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1096"></span><span>
</span><span id="line-1097"></span><span class="hs-comment">{-
A sequence of statements (as in a rec) is desugared to an arrow between
two environments (no stack)
-}</span><span>
</span><span id="line-1101"></span><span>
</span><span id="line-1102"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsfixCmdStmts"><span class="hs-identifier hs-type">dsfixCmdStmts</span></a></span><span>
</span><span id="line-1103"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-1104"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this statement</span><span>
</span><span id="line-1105"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- output vars of these statements</span><span>
</span><span id="line-1106"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#CmdLStmt"><span class="hs-identifier hs-type">CmdLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- statements to desugar</span><span>
</span><span id="line-1107"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-1108"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-1109"></span><span>                </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- same local vars as a list</span><span>
</span><span id="line-1110"></span><span>
</span><span id="line-1111"></span><span id="dsfixCmdStmts"><span class="annot"><span class="annottext">dsfixCmdStmts :: DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmdStmts"><span class="hs-identifier hs-var hs-var">dsfixCmdStmts</span></a></span></span><span> </span><span id="local-6989586621681155787"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155787"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155786"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155786"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155785"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155785"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span id="local-6989586621681155784"><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155784"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-1112"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; DsM (CoreExpr, DIdSet)) -&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#trimInput"><span class="hs-identifier hs-var">trimInput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdStmts"><span class="hs-identifier hs-var">dsCmdStmts</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155787"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155786"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155785"><span class="hs-identifier hs-var">out_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155784"><span class="hs-identifier hs-var">stmts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1113"></span><span>   </span><span class="hs-comment">-- TODO: Add levity polymorphism check for the resulting expression.</span><span>
</span><span id="line-1114"></span><span>   </span><span class="hs-comment">-- But I (Richard E.) don't know enough about arrows to do so.</span><span>
</span><span id="line-1115"></span><span>
</span><span id="line-1116"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmts"><span class="hs-identifier hs-type">dsCmdStmts</span></a></span><span>
</span><span id="line-1117"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.Arrows.html#DsCmdEnv"><span class="hs-identifier hs-type">DsCmdEnv</span></a></span><span>             </span><span class="hs-comment">-- arrow combinators</span><span>
</span><span id="line-1118"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span>                </span><span class="hs-comment">-- set of local vars available to this statement</span><span>
</span><span id="line-1119"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- output vars of these statements</span><span>
</span><span id="line-1120"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#CmdLStmt"><span class="hs-identifier hs-type">CmdLStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- statements to desugar</span><span>
</span><span id="line-1121"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- list of vars in the input to these statements</span><span>
</span><span id="line-1122"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- desugared expression</span><span>
</span><span id="line-1123"></span><span>                </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- subset of local vars that occur free</span><span>
</span><span id="line-1124"></span><span>
</span><span id="line-1125"></span><span id="dsCmdStmts"><span class="annot"><span class="annottext">dsCmdStmts :: DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdStmts"><span class="hs-identifier hs-var hs-var">dsCmdStmts</span></a></span></span><span> </span><span id="local-6989586621681155782"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155782"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155781"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155781"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155780"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155780"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681155779"><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155779"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="hs-special">]</span><span> </span><span id="local-6989586621681155778"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155778"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span>
</span><span id="line-1126"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; CmdLStmt (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLStmt"><span class="hs-identifier hs-var">dsCmdLStmt</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155782"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155781"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155780"><span class="hs-identifier hs-var">out_ids</span></a></span><span> </span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155779"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155778"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-1127"></span><span>
</span><span id="line-1128"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmts"><span class="hs-identifier hs-var">dsCmdStmts</span></a></span><span> </span><span id="local-6989586621681155777"><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155777"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681155776"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155776"><span class="hs-identifier hs-var">local_vars</span></a></span></span><span> </span><span id="local-6989586621681155775"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155775"><span class="hs-identifier hs-var">out_ids</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155774"><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155774"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155773"><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155773"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155772"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155772"><span class="hs-identifier hs-var">env_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1129"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155771"><span class="annot"><span class="annottext">bound_vars :: VarSet
</span><a href="#local-6989586621681155771"><span class="hs-identifier hs-var hs-var">bound_vars</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked) -&gt; [Id]
forall body. LStmt (GhcPass 'Typechecked) body -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectLStmtBinders"><span class="hs-identifier hs-var">collectLStmtBinders</span></a></span><span> </span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155774"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1130"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681155770"><span class="annot"><span class="annottext">local_vars' :: VarSet
</span><a href="#local-6989586621681155770"><span class="hs-identifier hs-var hs-var">local_vars'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155771"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155776"><span class="hs-identifier hs-var">local_vars</span></a></span><span>
</span><span id="line-1131"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155769"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155769"><span class="hs-identifier hs-var">core_stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155768"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155768"><span class="hs-identifier hs-var">_fv_stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155767"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155767"><span class="hs-identifier hs-var">env_ids'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; [CmdLStmt (GhcPass 'Typechecked)]
-&gt; DsM (CoreExpr, DIdSet, [Id])
</span><a href="GHC.HsToCore.Arrows.html#dsfixCmdStmts"><span class="hs-identifier hs-var">dsfixCmdStmts</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155777"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155770"><span class="hs-identifier hs-var">local_vars'</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155775"><span class="hs-identifier hs-var">out_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[CmdLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155773"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-1132"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681155766"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155766"><span class="hs-identifier hs-var">core_stmt</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155765"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155765"><span class="hs-identifier hs-var">fv_stmt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; VarSet
-&gt; [Id]
-&gt; CmdLStmt (GhcPass 'Typechecked)
-&gt; [Id]
-&gt; DsM (CoreExpr, DIdSet)
</span><a href="GHC.HsToCore.Arrows.html#dsCmdLStmt"><span class="hs-identifier hs-var">dsCmdLStmt</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155777"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155776"><span class="hs-identifier hs-var">local_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155767"><span class="hs-identifier hs-var">env_ids'</span></a></span><span> </span><span class="annot"><span class="annottext">CmdLStmt (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155774"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155772"><span class="hs-identifier hs-var">env_ids</span></a></span><span>
</span><span id="line-1133"></span><span>    </span><span class="annot"><span class="annottext">(CoreExpr, DIdSet) -&gt; DsM (CoreExpr, DIdSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DsCmdEnv
-&gt; Type -&gt; Type -&gt; Type -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#do_compose"><span class="hs-identifier hs-var">do_compose</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><a href="#local-6989586621681155777"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-1134"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155772"><span class="hs-identifier hs-var">env_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1135"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155767"><span class="hs-identifier hs-var">env_ids'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1136"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Type
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155775"><span class="hs-identifier hs-var">out_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1137"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155766"><span class="hs-identifier hs-var">core_stmt</span></a></span><span>
</span><span id="line-1138"></span><span>                </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155769"><span class="hs-identifier hs-var">core_stmts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1139"></span><span>              </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621681155765"><span class="hs-identifier hs-var">fv_stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1140"></span><span>
</span><span id="line-1141"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#dsCmdStmts"><span class="hs-identifier hs-var">dsCmdStmts</span></a></span><span> </span><span class="annot"><span class="annottext">DsCmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM (CoreExpr, DIdSet)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsCmdStmts []&quot;</span></span><span>
</span><span id="line-1142"></span><span>
</span><span id="line-1143"></span><span class="hs-comment">-- Match a list of expressions against a list of patterns, left-to-right.</span><span>
</span><span id="line-1144"></span><span>
</span><span id="line-1145"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchSimplys"><span class="hs-identifier hs-type">matchSimplys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span>              </span><span class="hs-comment">-- Scrutinees</span><span>
</span><span id="line-1146"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>    </span><span class="hs-comment">-- Match kind</span><span>
</span><span id="line-1147"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>            </span><span class="hs-comment">-- Patterns they should match</span><span>
</span><span id="line-1148"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>                </span><span class="hs-comment">-- Return this if they all match</span><span>
</span><span id="line-1149"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>                </span><span class="hs-comment">-- Return this if they don't</span><span>
</span><span id="line-1150"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1151"></span><span id="matchSimplys"><span class="annot"><span class="annottext">matchSimplys :: [CoreExpr]
-&gt; HsMatchContext GhcRn
-&gt; [LPat (GhcPass 'Typechecked)]
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchSimplys"><span class="hs-identifier hs-var hs-var">matchSimplys</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681155764"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681155764"><span class="hs-identifier hs-var">_ctxt</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681155763"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155763"><span class="hs-identifier hs-var">result_expr</span></a></span></span><span> </span><span id="local-6989586621681155762"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155762"><span class="hs-identifier hs-var">_fail_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155763"><span class="hs-identifier hs-var">result_expr</span></a></span><span>
</span><span id="line-1152"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchSimplys"><span class="hs-identifier hs-var">matchSimplys</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155761"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155761"><span class="hs-identifier hs-var">exp</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155760"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155760"><span class="hs-identifier hs-var">exps</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155759"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681155759"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155758"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155758"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155757"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155757"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155756"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155756"><span class="hs-identifier hs-var">result_expr</span></a></span></span><span> </span><span id="local-6989586621681155755"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155755"><span class="hs-identifier hs-var">fail_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1153"></span><span>    </span><span id="local-6989586621681155754"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155754"><span class="hs-identifier hs-var">match_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
-&gt; HsMatchContext GhcRn
-&gt; [LPat (GhcPass 'Typechecked)]
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Arrows.html#matchSimplys"><span class="hs-identifier hs-var">matchSimplys</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681155760"><span class="hs-identifier hs-var">exps</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681155759"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155757"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155756"><span class="hs-identifier hs-var">result_expr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155755"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-1154"></span><span>    </span><span class="annot"><span class="annottext">CoreExpr
-&gt; HsMatchContext GhcRn
-&gt; LPat (GhcPass 'Typechecked)
-&gt; CoreExpr
-&gt; CoreExpr
-&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.html#matchSimply"><span class="hs-identifier hs-var">matchSimply</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155761"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681155759"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155758"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155754"><span class="hs-identifier hs-var">match_code</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681155755"><span class="hs-identifier hs-var">fail_expr</span></a></span><span>
</span><span id="line-1155"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#matchSimplys"><span class="hs-identifier hs-var">matchSimplys</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM CoreExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchSimplys&quot;</span></span><span>
</span><span id="line-1156"></span><span>
</span><span id="line-1157"></span><span class="hs-comment">-- List of leaf expressions, with set of variables bound in each</span><span>
</span><span id="line-1158"></span><span>
</span><span id="line-1159"></span><span id="local-6989586621681156894"><span class="annot"><a href="GHC.HsToCore.Arrows.html#leavesMatch"><span class="hs-identifier hs-type">leavesMatch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156894"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1160"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156894"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#IdSet"><span class="hs-identifier hs-type">IdSet</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-1161"></span><span id="leavesMatch"><span class="annot"><span class="annottext">leavesMatch :: forall (body :: * -&gt; *).
LMatch
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; [(Located (body (GhcPass 'Typechecked)), VarSet)]
</span><a href="GHC.HsToCore.Arrows.html#leavesMatch"><span class="hs-identifier hs-var hs-var">leavesMatch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155752"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155752"><span class="hs-identifier hs-var">pats</span></a></span></span><span>
</span><span id="line-1162"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155751"><span class="annot"><span class="annottext">[LGRHS
   (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))]
</span><a href="#local-6989586621681155751"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155750"><span class="annot"><span class="annottext">HsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155750"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1163"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-1164"></span><span>        </span><span id="local-6989586621681155749"><span class="annot"><span class="annottext">defined_vars :: VarSet
</span><a href="#local-6989586621681155749"><span class="hs-identifier hs-var hs-var">defined_vars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectPatsBinders"><span class="hs-identifier hs-var">collectPatsBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155752"><span class="hs-identifier hs-var">pats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1165"></span><span>                        </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span>
</span><span id="line-1166"></span><span>                       </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsLocalBinds (GhcPass 'Typechecked) -&gt; [IdP (GhcPass 'Typechecked)]
forall (idL :: Pass) (idR :: Pass).
CollectPass (GhcPass idL) =&gt;
HsLocalBindsLR (GhcPass idL) (GhcPass idR) -&gt; [IdP (GhcPass idL)]
</span><a href="GHC.Hs.Utils.html#collectLocalBinders"><span class="hs-identifier hs-var">collectLocalBinders</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155750"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1167"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-1168"></span><span>    </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (body (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155748"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-1169"></span><span>      </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[GuardLStmt (GhcPass 'Typechecked)] -&gt; [Id]
forall body. [LStmt (GhcPass 'Typechecked) body] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectLStmtsBinders"><span class="hs-identifier hs-var">collectLStmtsBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155746"><span class="hs-identifier hs-var">stmts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1170"></span><span>        </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681155749"><span class="hs-identifier hs-var">defined_vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1171"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155746"><span class="annot"><span class="annottext">[GuardLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155746"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681155748"><span class="annot"><span class="annottext">Located (body (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155748"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LGRHS
   (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))]
</span><a href="#local-6989586621681155751"><span class="hs-identifier hs-var">grhss</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1172"></span><span>
</span><span id="line-1173"></span><span class="hs-comment">-- Replace the leaf commands in a match</span><span>
</span><span id="line-1174"></span><span>
</span><span id="line-1175"></span><span id="local-6989586621681156873"><span id="local-6989586621681156874"><span class="annot"><a href="GHC.HsToCore.Arrows.html#replaceLeavesMatch"><span class="hs-identifier hs-type">replaceLeavesMatch</span></a></span><span>
</span><span id="line-1176"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                                 </span><span class="hs-comment">-- new result type</span><span>
</span><span id="line-1177"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156874"><span class="hs-identifier hs-type">body'</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- replacement leaf expressions of that type</span><span>
</span><span id="line-1178"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156873"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- the matches of a case command</span><span>
</span><span id="line-1179"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156874"><span class="hs-identifier hs-type">body'</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- remaining leaf expressions</span><span>
</span><span id="line-1180"></span><span>            </span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156874"><span class="hs-identifier hs-type">body'</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span></span><span> </span><span class="hs-comment">-- updated match</span><span>
</span><span id="line-1181"></span><span id="replaceLeavesMatch"><span class="annot"><span class="annottext">replaceLeavesMatch :: forall (body' :: * -&gt; *) (body :: * -&gt; *).
Type
-&gt; [Located (body' (GhcPass 'Typechecked))]
-&gt; LMatch
     (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    LMatch
      (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
</span><a href="GHC.HsToCore.Arrows.html#replaceLeavesMatch"><span class="hs-identifier hs-var hs-var">replaceLeavesMatch</span></a></span></span><span> </span><span id="local-6989586621681155744"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681155744"><span class="hs-identifier hs-var">_res_ty</span></a></span></span><span> </span><span id="local-6989586621681155743"><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681155743"><span class="hs-identifier hs-var">leaves</span></a></span></span><span>
</span><span id="line-1182"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681155742"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155742"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-1183"></span><span>                          </span><span id="local-6989586621681155741"><span class="annot"><span class="annottext">match :: Match
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><a href="#local-6989586621681155741"><span class="hs-identifier hs-var">match</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span id="local-6989586621681155740"><span class="annot"><span class="annottext">XCGRHSs
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><a href="#local-6989586621681155740"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681155739"><span class="annot"><span class="annottext">[LGRHS
   (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))]
</span><a href="#local-6989586621681155739"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span id="local-6989586621681155738"><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155738"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1184"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-1185"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681155737"><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681155737"><span class="hs-identifier hs-var">leaves'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681155736"><span class="annot"><span class="annottext">[LGRHS
   (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))]
</span><a href="#local-6989586621681155736"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Located (body' (GhcPass 'Typechecked))]
 -&gt; LGRHS
      (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
 -&gt; ([Located (body' (GhcPass 'Typechecked))],
     LGRHS
       (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))))
-&gt; [Located (body' (GhcPass 'Typechecked))]
-&gt; [LGRHS
      (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))]
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    [LGRHS
       (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
-&gt; LGRHS
     (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    LGRHS
      (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
forall (body' :: * -&gt; *) (body :: * -&gt; *).
[Located (body' (GhcPass 'Typechecked))]
-&gt; LGRHS
     (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    LGRHS
      (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
</span><a href="GHC.HsToCore.Arrows.html#replaceLeavesGRHS"><span class="hs-identifier hs-var">replaceLeavesGRHS</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681155743"><span class="hs-identifier hs-var">leaves</span></a></span><span> </span><span class="annot"><span class="annottext">[LGRHS
   (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))]
</span><a href="#local-6989586621681155739"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-1186"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-1187"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681155737"><span class="hs-identifier hs-var">leaves'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; Match
     (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
-&gt; GenLocated
     SrcSpan
     (Match
        (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155742"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><a href="#local-6989586621681155741"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_ext :: XCMatch
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
</span><a href="GHC.Hs.Expr.html#m_ext"><span class="hs-identifier hs-var">m_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XCMatch
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: GRHSs
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XCGRHSs
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
-&gt; [LGRHS
      (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))]
-&gt; LHsLocalBinds (GhcPass 'Typechecked)
-&gt; GRHSs
     (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
forall p body.
XCGRHSs p body -&gt; [LGRHS p body] -&gt; LHsLocalBinds p -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-var">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
XCGRHSs
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><a href="#local-6989586621681155740"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[LGRHS
   (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))]
</span><a href="#local-6989586621681155736"><span class="hs-identifier hs-var">grhss'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsLocalBinds (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155738"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1188"></span><span>
</span><span id="line-1189"></span><span id="local-6989586621681156817"><span id="local-6989586621681156818"><span class="annot"><a href="GHC.HsToCore.Arrows.html#replaceLeavesGRHS"><span class="hs-identifier hs-type">replaceLeavesGRHS</span></a></span><span>
</span><span id="line-1190"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156818"><span class="hs-identifier hs-type">body'</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- replacement leaf expressions of that type</span><span>
</span><span id="line-1191"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LGRHS"><span class="hs-identifier hs-type">LGRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156817"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- rhss of a case command</span><span>
</span><span id="line-1192"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156818"><span class="hs-identifier hs-type">body'</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>              </span><span class="hs-comment">-- remaining leaf expressions</span><span>
</span><span id="line-1193"></span><span>            </span><span class="annot"><a href="GHC.Hs.Expr.html#LGRHS"><span class="hs-identifier hs-type">LGRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156818"><span class="hs-identifier hs-type">body'</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span></span><span>  </span><span class="hs-comment">-- updated GRHS</span><span>
</span><span id="line-1194"></span><span id="replaceLeavesGRHS"><span class="annot"><span class="annottext">replaceLeavesGRHS :: forall (body' :: * -&gt; *) (body :: * -&gt; *).
[Located (body' (GhcPass 'Typechecked))]
-&gt; LGRHS
     (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    LGRHS
      (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
</span><a href="GHC.HsToCore.Arrows.html#replaceLeavesGRHS"><span class="hs-identifier hs-var hs-var">replaceLeavesGRHS</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155733"><span class="annot"><span class="annottext">Located (body' (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155733"><span class="hs-identifier hs-var">leaf</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155732"><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681155732"><span class="hs-identifier hs-var">leaves</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681155731"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155731"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span id="local-6989586621681155730"><span class="annot"><span class="annottext">XCGRHS
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><a href="#local-6989586621681155730"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681155729"><span class="annot"><span class="annottext">[GuardLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155729"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span class="annot"><span class="annottext">Located (body (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1195"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located (body' (GhcPass 'Typechecked))]
</span><a href="#local-6989586621681155732"><span class="hs-identifier hs-var">leaves</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; GRHS
     (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
-&gt; GenLocated
     SrcSpan
     (GRHS
        (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked))))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681155731"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHS
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
-&gt; [GuardLStmt (GhcPass 'Typechecked)]
-&gt; Located (body' (GhcPass 'Typechecked))
-&gt; GRHS
     (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
forall p body.
XCGRHS p body -&gt; [GuardLStmt p] -&gt; body -&gt; GRHS p body
</span><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-var">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS
  (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))
XCGRHS
  (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked)))
</span><a href="#local-6989586621681155730"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155729"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body' (GhcPass 'Typechecked))
</span><a href="#local-6989586621681155733"><span class="hs-identifier hs-var">leaf</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1196"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#replaceLeavesGRHS"><span class="hs-identifier hs-var">replaceLeavesGRHS</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">GenLocated
  SrcSpan
  (GRHS
     (GhcPass 'Typechecked) (Located (body (GhcPass 'Typechecked))))
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; ([Located (body' (GhcPass 'Typechecked))],
    GenLocated
      SrcSpan
      (GRHS
         (GhcPass 'Typechecked) (Located (body' (GhcPass 'Typechecked)))))
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;replaceLeavesGRHS []&quot;</span></span><span>
</span><span id="line-1197"></span><span>
</span><span id="line-1198"></span><span class="hs-comment">-- Balanced fold of a non-empty list.</span><span>
</span><span id="line-1199"></span><span>
</span><span id="line-1200"></span><span id="local-6989586621681156879"><span class="annot"><a href="GHC.HsToCore.Arrows.html#foldb"><span class="hs-identifier hs-type">foldb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681156879"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681156879"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681156879"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681156879"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681156879"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1201"></span><span id="foldb"><span class="annot"><span class="annottext">foldb :: forall a. (a -&gt; a -&gt; a) -&gt; [a] -&gt; a
</span><a href="GHC.HsToCore.Arrows.html#foldb"><span class="hs-identifier hs-var hs-var">foldb</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;foldb of empty list&quot;</span></span><span>
</span><span id="line-1202"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#foldb"><span class="hs-identifier hs-var">foldb</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681155725"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155725"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155725"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1203"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#foldb"><span class="hs-identifier hs-var">foldb</span></a></span><span> </span><span id="local-6989586621681155724"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621681155724"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681155723"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681155723"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; [a] -&gt; a
forall a. (a -&gt; a -&gt; a) -&gt; [a] -&gt; a
</span><a href="GHC.HsToCore.Arrows.html#foldb"><span class="hs-identifier hs-var">foldb</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621681155724"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; [a]
</span><a href="#local-6989586621681155722"><span class="hs-identifier hs-var">fold_pairs</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681155723"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1204"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1205"></span><span>    </span><span id="local-6989586621681155722"><span class="annot"><span class="annottext">fold_pairs :: [a] -&gt; [a]
</span><a href="#local-6989586621681155722"><span class="hs-identifier hs-var hs-var">fold_pairs</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1206"></span><span>    </span><span class="annot"><a href="#local-6989586621681155722"><span class="hs-identifier hs-var">fold_pairs</span></a></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681155721"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155721"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155721"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1207"></span><span>    </span><span class="annot"><a href="#local-6989586621681155722"><span class="hs-identifier hs-var">fold_pairs</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681155720"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155720"><span class="hs-identifier hs-var">x1</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155719"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155719"><span class="hs-identifier hs-var">x2</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681155718"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681155718"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621681155724"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155720"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681155719"><span class="hs-identifier hs-var">x2</span></a></span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[a] -&gt; [a]
</span><a href="#local-6989586621681155722"><span class="hs-identifier hs-var">fold_pairs</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681155718"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1208"></span><span>
</span><span id="line-1209"></span><span class="hs-comment">{-
Note [Dictionary binders in ConPatOut] See also same Note in GHC.Hs.Utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following functions to collect value variables from patterns are
copied from GHC.Hs.Utils, with one change: we also collect the dictionary
bindings (cpt_binds) from ConPatOut.  We need them for cases like

h :: Arrow a =&gt; Int -&gt; a (Int,Int) Int
h x = proc (y,z) -&gt; case compare x y of
                GT -&gt; returnA -&lt; z+x

The type checker turns the case into

                case compare x y of
                  GT { p77 = plusInt } -&gt; returnA -&lt; p77 z x

Here p77 is a local binding for the (+) operation.

See comments in GHC.Hs.Utils for why the other version does not include
these bindings.
-}</span><span>
</span><span id="line-1230"></span><span>
</span><span id="line-1231"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectPatBinders"><span class="hs-identifier hs-type">collectPatBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1232"></span><span id="collectPatBinders"><span class="annot"><span class="annottext">collectPatBinders :: LPat (GhcPass 'Typechecked) -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectPatBinders"><span class="hs-identifier hs-var hs-var">collectPatBinders</span></a></span></span><span> </span><span id="local-6989586621681155717"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155717"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155717"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1233"></span><span>
</span><span id="line-1234"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectPatsBinders"><span class="hs-identifier hs-type">collectPatsBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1235"></span><span id="collectPatsBinders"><span class="annot"><span class="annottext">collectPatsBinders :: [LPat (GhcPass 'Typechecked)] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectPatsBinders"><span class="hs-identifier hs-var hs-var">collectPatsBinders</span></a></span></span><span> </span><span id="local-6989586621681155715"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155715"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id])
-&gt; [Id] -&gt; [Located (Pat (GhcPass 'Typechecked))] -&gt; [Id]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id]
LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Located (Pat (GhcPass 'Typechecked))]
[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155715"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-1236"></span><span>
</span><span id="line-1237"></span><span class="hs-comment">---------------------</span><span>
</span><span id="line-1238"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-type">collectl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1239"></span><span class="hs-comment">-- See Note [Dictionary binders in ConPatOut]</span><span>
</span><span id="line-1240"></span><span id="collectl"><span class="annot"><span class="annottext">collectl :: LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var hs-var">collectl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155713"><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155713"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155712"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span>
</span><span id="line-1241"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked) -&gt; [Id]
</span><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155713"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-1242"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1243"></span><span>    </span><span id="local-6989586621681155711"><span class="annot"><span class="annottext">go :: Pat (GhcPass 'Typechecked) -&gt; [Id]
</span><a href="#local-6989586621681155711"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#VarPat"><span class="hs-identifier hs-type">VarPat</span></a></span><span> </span><span class="annot"><span class="annottext">XVarPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155709"><span class="annot"><span class="annottext">IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155709"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155709"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1244"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-type">WildPat</span></a></span><span> </span><span class="annot"><span class="annottext">XWildPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1245"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LazyPat"><span class="hs-identifier hs-type">LazyPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLazyPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155706"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155706"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155706"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1246"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">XBangPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155704"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155704"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155704"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1247"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#AsPat"><span class="hs-identifier hs-type">AsPat</span></a></span><span> </span><span class="annot"><span class="annottext">XAsPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155702"><span class="annot"><span class="annottext">IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155702"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155701"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155701"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155702"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155701"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1248"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ParPat"><span class="hs-identifier hs-type">ParPat</span></a></span><span> </span><span class="annot"><span class="annottext">XParPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155699"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155699"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155699"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1249"></span><span>
</span><span id="line-1250"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="annot"><span class="annottext">XListPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155697"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155697"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id])
-&gt; [Id] -&gt; [Located (Pat (GhcPass 'Typechecked))] -&gt; [Id]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id]
LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat (GhcPass 'Typechecked))]
[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155697"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-1251"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#TuplePat"><span class="hs-identifier hs-type">TuplePat</span></a></span><span> </span><span class="annot"><span class="annottext">XTuplePat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155695"><span class="annot"><span class="annottext">[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155695"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id])
-&gt; [Id] -&gt; [Located (Pat (GhcPass 'Typechecked))] -&gt; [Id]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id]
LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat (GhcPass 'Typechecked))]
[LPat (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155695"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-1252"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SumPat"><span class="hs-identifier hs-type">SumPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSumPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155693"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155693"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155693"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1253"></span><span>
</span><span id="line-1254"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ConPat"><span class="hs-identifier hs-type">ConPat</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_args :: forall p. Pat p -&gt; HsConPatDetails p
</span><a href="GHC.Hs.Pat.html#pat_args"><span class="hs-identifier hs-var">pat_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155690"><span class="annot"><span class="annottext">HsConPatDetails (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155690"><span class="hs-identifier hs-var">ps</span></a></span></span><span>
</span><span id="line-1255"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_con_ext :: forall p. Pat p -&gt; XConPat p
</span><a href="GHC.Hs.Pat.html#pat_con_ext"><span class="hs-identifier hs-var">pat_con_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#ConPatTc"><span class="hs-identifier hs-type">ConPatTc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpt_binds :: ConPatTc -&gt; TcEvBinds
</span><a href="GHC.Hs.Pat.html#cpt_binds"><span class="hs-identifier hs-var">cpt_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155686"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681155686"><span class="hs-identifier hs-var">ds</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1256"></span><span>                                    </span><span class="annot"><span class="annottext">TcEvBinds -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectEvBinders"><span class="hs-identifier hs-var">collectEvBinders</span></a></span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681155686"><span class="hs-identifier hs-var">ds</span></a></span><span>
</span><span id="line-1257"></span><span>                                    </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [Id]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id])
-&gt; [Id] -&gt; [Located (Pat (GhcPass 'Typechecked))] -&gt; [Id]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat (GhcPass 'Typechecked)) -&gt; [Id] -&gt; [Id]
LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsConPatDetails (GhcPass 'Typechecked)
-&gt; [LPat (GhcPass 'Typechecked)]
forall p. HsConPatDetails p -&gt; [LPat p]
</span><a href="GHC.Hs.Pat.html#hsConPatArgs"><span class="hs-identifier hs-var">hsConPatArgs</span></a></span><span> </span><span class="annot"><span class="annottext">HsConPatDetails (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155690"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1258"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-type">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLitPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsLit (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1259"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPat"><span class="hs-identifier hs-type">NPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1260"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPlusKPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155680"><span class="annot"><span class="annottext">IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155680"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located (HsOverLit (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsOverLit (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
IdP (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155680"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1261"></span><span>
</span><span id="line-1262"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SigPat"><span class="hs-identifier hs-type">SigPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSigPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155678"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155678"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsPatSigType (NoGhcTc (GhcPass 'Typechecked))
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155678"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1263"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-type">XPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-type">CoPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155675"><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155675"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked) -&gt; Located (Pat (GhcPass 'Typechecked))
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155675"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1264"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ViewPat"><span class="hs-identifier hs-type">ViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">XViewPat (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Typechecked)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681155673"><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155673"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked) -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectl"><span class="hs-identifier hs-var">collectl</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155673"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155712"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1265"></span><span>    </span><span class="annot"><a href="#local-6989586621681155711"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681155672"><span class="annot"><span class="annottext">p :: Pat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155672"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [Id]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;collectl/go&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Pat (GhcPass 'Typechecked)
</span><a href="#local-6989586621681155672"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1266"></span><span>
</span><span id="line-1267"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectEvBinders"><span class="hs-identifier hs-type">collectEvBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1268"></span><span id="collectEvBinders"><span class="annot"><span class="annottext">collectEvBinders :: TcEvBinds -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectEvBinders"><span class="hs-identifier hs-var hs-var">collectEvBinders</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBinds"><span class="hs-identifier hs-type">EvBinds</span></a></span><span> </span><span id="local-6989586621681155669"><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681155669"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(EvBind -&gt; [Id] -&gt; [Id]) -&gt; [Id] -&gt; Bag EvBind -&gt; [Id]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">EvBind -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#add_ev_bndr"><span class="hs-identifier hs-var">add_ev_bndr</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681155669"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1269"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectEvBinders"><span class="hs-identifier hs-var">collectEvBinders</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Id]
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ToDo: collectEvBinders&quot;</span></span><span>
</span><span id="line-1270"></span><span>
</span><span id="line-1271"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#add_ev_bndr"><span class="hs-identifier hs-type">add_ev_bndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier hs-type">EvBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1272"></span><span id="add_ev_bndr"><span class="annot"><span class="annottext">add_ev_bndr :: EvBind -&gt; [Id] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#add_ev_bndr"><span class="hs-identifier hs-var hs-var">add_ev_bndr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier hs-type">EvBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eb_lhs :: EvBind -&gt; Id
</span><a href="GHC.Tc.Types.Evidence.html#eb_lhs"><span class="hs-identifier hs-var">eb_lhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155664"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155664"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681155663"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155663"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155664"><span class="hs-identifier hs-var">b</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681155664"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155663"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1273"></span><span>                                       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681155663"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1274"></span><span>  </span><span class="hs-comment">-- A worry: what about coercion variable binders??</span><span>
</span><span id="line-1275"></span><span>
</span><span id="line-1276"></span><span id="local-6989586621681156821"><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectLStmtsBinders"><span class="hs-identifier hs-type">collectLStmtsBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681156821"><span class="hs-identifier hs-type">body</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1277"></span><span id="collectLStmtsBinders"><span class="annot"><span class="annottext">collectLStmtsBinders :: forall body. [LStmt (GhcPass 'Typechecked) body] -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectLStmtsBinders"><span class="hs-identifier hs-var hs-var">collectLStmtsBinders</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LStmt (GhcPass 'Typechecked) body -&gt; [Id])
-&gt; [LStmt (GhcPass 'Typechecked) body] -&gt; [Id]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">LStmt (GhcPass 'Typechecked) body -&gt; [Id]
forall body. LStmt (GhcPass 'Typechecked) body -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectLStmtBinders"><span class="hs-identifier hs-var">collectLStmtBinders</span></a></span><span>
</span><span id="line-1278"></span><span>
</span><span id="line-1279"></span><span id="local-6989586621681156843"><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectLStmtBinders"><span class="hs-identifier hs-type">collectLStmtBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681156843"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1280"></span><span id="collectLStmtBinders"><span class="annot"><span class="annottext">collectLStmtBinders :: forall body. LStmt (GhcPass 'Typechecked) body -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectLStmtBinders"><span class="hs-identifier hs-var hs-var">collectLStmtBinders</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stmt (GhcPass 'Typechecked) body -&gt; [Id]
forall body. Stmt (GhcPass 'Typechecked) body -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectStmtBinders"><span class="hs-identifier hs-var">collectStmtBinders</span></a></span><span> </span><span class="annot"><span class="annottext">(Stmt (GhcPass 'Typechecked) body -&gt; [Id])
-&gt; (GenLocated SrcSpan (Stmt (GhcPass 'Typechecked) body)
    -&gt; Stmt (GhcPass 'Typechecked) body)
-&gt; GenLocated SrcSpan (Stmt (GhcPass 'Typechecked) body)
-&gt; [Id]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Stmt (GhcPass 'Typechecked) body)
-&gt; Stmt (GhcPass 'Typechecked) body
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span>
</span><span id="line-1281"></span><span>
</span><span id="line-1282"></span><span id="local-6989586621681156774"><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectStmtBinders"><span class="hs-identifier hs-type">collectStmtBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681156774"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1283"></span><span id="collectStmtBinders"><span class="annot"><span class="annottext">collectStmtBinders :: forall body. Stmt (GhcPass 'Typechecked) body -&gt; [Id]
</span><a href="GHC.HsToCore.Arrows.html#collectStmtBinders"><span class="hs-identifier hs-var hs-var">collectStmtBinders</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_later_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_later_ids"><span class="hs-identifier hs-var">recS_later_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681155657"><span class="annot"><span class="annottext">[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155657"><span class="hs-identifier hs-var">later_ids</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP (GhcPass 'Typechecked)]
</span><a href="#local-6989586621681155657"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-1284"></span><span class="annot"><a href="GHC.HsToCore.Arrows.html#collectStmtBinders"><span class="hs-identifier hs-var">collectStmtBinders</span></a></span><span> </span><span id="local-6989586621681155656"><span class="annot"><span class="annottext">StmtLR (GhcPass 'Typechecked) (GhcPass 'Typechecked) body
</span><a href="#local-6989586621681155656"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StmtLR (GhcPass 'Typechecked) (GhcPass 'Typechecked) body
-&gt; [IdP (GhcPass 'Typechecked)]
forall (idL :: Pass) (idR :: Pass) body.
CollectPass (GhcPass idL) =&gt;
StmtLR (GhcPass idL) (GhcPass idR) body -&gt; [IdP (GhcPass idL)]
</span><a href="GHC.Hs.Utils.html#collectStmtBinders"><span class="hs-identifier hs-var">HsUtils.collectStmtBinders</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR (GhcPass 'Typechecked) (GhcPass 'Typechecked) body
</span><a href="#local-6989586621681155656"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-1285"></span></pre></body></html>